Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Is it worth me continuing?

I dont often ask this question. But today I spent a jolly good amount of time on the enhance a simple php application course.

I got to the point where I was doing the config file for my variables and constants to build file paths for images and includes. And I followed it to the letter.

Except mine had one crucial difference.

The site I uploaded the files to did not exist in the root part of my server because that's where my own website lives. And I'm in no hurry to create a new domain for the shirts 4 Mike example.

The solution is of course obvious. Download the local server software suggested by the course as a place for the files to live. The reason I haven't done this yet is my it situation is a little up in the air at the moment, and I'm using as much time as I can find to keep up with the a treehouse course.

At the moment, the CSS is not working on Shirts 4 Mike no matter what Base or Root path I use. Should I continue with the course and carry on regardless? Is it possible to learn without following along? Or should I try another course in the meantime until my personal situation is a little more "normal" again?

Thanks :)

Iain Diamond
Iain Diamond
29,379 Points

I have two thoughts:

Sometimes, when things are not working out as planned it's helpful to take a break. Hopefully, you'll come back later reenergised and with a clear head.

iain

1 Answer

Hmmm.. I think for a course that's based around a server side language, then a server is something you need. I would say that installing a local server (like MAMP, WAMP or XAMPP) is equally as educational as a Treehouse course. It's definitely a handy piece of know-how for the future and a must-have piece of software to have on your computer. Local servers and setups range in complexity and as your requirements grow, so will your stack. but for speed, I would stick with these popular, well documented, free choices.

It's possible to continue and keep learning without having a local server - but without following along, you might want to ask yourself how much of the information you're retaining.

It should take no more than an 45 minutes to set up a local server - and you have everyone on the Treehouse forum ready to help out!

What operating system are you using?

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi Tom,

I still have my web host where I successfully followed the Build a simple application course in php. And I followed along just fine in the enhancement course up until I started making my config file and done things with Base URLs and a document root paths.

Clearly my web server has a different path to that used on a local server. Before long I was finding myself on a path of oblivion where some pages weren't picking up CSS, some weren't picking up images despite accounting for the document paths in my variable constants. I understand the theory underlying it but you're right that I'm not picking up the technical information very well. I have a poor working memory for programming and I tend to remember these things in "bits".

I'm doing php in conjunction with the Wordpress tracks. Learn Wordpress, Php and Wordpress Development. So my goal Isn't really to learn Ecommerce websites (although it's cool if I can learn that. It's to be able to learn enough php to get my starting on learning how to make Wordpress themes.

I actually use the Windows Operating system. I'm popping between 8 and 7 at the moment but my other handicap Is that I'm not using my own machine at the moment because is on the blink :). So I'm wary about downloading too much stuff until I get my new workspace sorted... After I've moved house next month.

Ah okay, so you worked remotely on previous projects! I understand. Let's stick with that option as you're already set up.

A good way to get debugging on paths is to dump out the location of the current file.

<?php

echo dirname(__FILE__);
exit;

You can then work backwards and hopefully work out the best file paths you need to apply.

I've looked around and MAMP, WAMP and XXAMP all support/are built for windows. I couldn't help re recommending because I've only used MAMP. If your current machine is touch and go, it may not be worth all the effort of installation ;)

If you're still having trouble applying the correct paths, can you paste in your code so I can take a look?

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

What's the difference between the 3 of those, I wonder? I think I used WAMP previously. When I'm a bit more stable in terms of my IT set up I'll try installing that again and working locally when developing PHP projects. It might even be better than FTP'ing files and refreshing the browser ;)

But at the moment I'm so out of sync with this project that it's problably best just going from scratch anyway, I'm going through the videos and just noting down concepts and code I think might b useful to remember but I've pretty much given up following along painstaking.

I don't have an issue with the concept of using Constants to define file paths but tor whatever reason the file paths I use never seem to work properly ,