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 trialKelvin Atawura
Front End Web Development Techdegree Student 19,022 Pointsproject file this not working
i have downloaded the first and second step of this stage and non of the project files seem to be workin? Randy Hoyt Hampton Paulk l hope you guys can help please. the broswer just turns up with a blank screen
1 Answer
Tom Mertz
15,254 PointsDid you remember to turn on your local webserver?
EDIT: Did you save the project files directly into your htdocs folder? For example:
htdocs
index.php
.htaccess
shirts/
search
inc
Or did you save them into a subfolder in your htdocs?
htdocs
shirts4mike/
index.php
.htaccess
shirts/
inc/
search/
If you did the latter, you'll need to change your config.php file in the inc folder to have a base url of /shirts4mike/ (or whatever your folder is named)
define("BASE_URL", "/shirts4mike/");
define("ROOT_PATH", $_SERVER["DOCUMENT_ROOT"] . "/shirts4mike/");
Kelvin Atawura
Front End Web Development Techdegree Student 19,022 PointsKelvin Atawura
Front End Web Development Techdegree Student 19,022 Pointsl did i am using MAMP and got both severs on. But didnt seem to work.
Tom Mertz
15,254 PointsTom Mertz
15,254 PointsAre you getting any errors, or just a blank screen? Recheck my comment above. I just got the page working by downloading it, so the files are good to go.
Kelvin Atawura
Front End Web Development Techdegree Student 19,022 PointsKelvin Atawura
Front End Web Development Techdegree Student 19,022 Pointsl downloaded it straight into my htdocs folder so its got a path of htdocs/project02-stage04-shirts4mike and obviously the files and the sub-folders like the search folder in there. would have to still change the php root like you said above?
Tom Mertz
15,254 PointsTom Mertz
15,254 PointsYeah, you would have to change you config.php file. If I'm not mistaken you'd have to set your BASE_URL to "/project02-stage04-shirts4mike/ and the same for your ROOT_PATH
Like this
This will also change all the rewrites you'll have to do later, so it might just be easier to copy all of the contents of the project02-stage04-shirts4mike/ folder straight into the htdocs directory.
Kelvin Atawura
Front End Web Development Techdegree Student 19,022 PointsKelvin Atawura
Front End Web Development Techdegree Student 19,022 Pointsonly problem with copying everything straight into the htdocs is i got other files that and dont want it mix everything up. But the method you described above works perfectly for me only issue am having now is the shirts page wont load part from that everything works pefectly. any ideas about the that or do i need to change its root aswell?
Tom Mertz
15,254 PointsTom Mertz
15,254 PointsThat has to do with your rewrites in the .htaccess file. The project files come loaded up with an .htaccess file that assumes you have all the project files right in the htdocs directory. So you have to edit all of the rules to include the name of your folder that the files are in. Here's an example if your folder name was shirts4mike2:
Good luck, man.