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 Setup Your Local Development Environment

Alexandra Sophie Coyle
Alexandra Sophie Coyle
1,616 Points

Can’t view index.php from any other folder only htdocs

Hi I have tried changing the folder from htdocs to a new folder called sites in my documents folder - I followed the steps in the video but I can’t get it to work - I turned off I cloud - once I change the root back to mamp/htdocs/ The index.php is viewable on local host my sites - any suggestions what am I missing?

4 Answers

jonathanbarrios
STAFF
jonathanbarrios
Treehouse Teacher

Hi Alexandra Sophie Coyle,

If you followed the video steps at 5:40 where you change the document root to another directory, it should work. I verified that it works so make sure you followed those steps. There are other configuration settings that could be causing a problem so make sure another instance of apache isn't running in the background. Try restarting your machine and if you're still having problems, try searching for similar issues from other users using Google, or any other search engine.

Alexandra Sophie Coyle
Alexandra Sophie Coyle
1,616 Points

HI I finally got it to work - I had set the ports to 80 3306 like it says in the video - I reset the ports to 8888 and it now works I can view my index.php page my local host path is user/documents/sites/testsite1/index.php - have decided to learn more about ports - really happy thanks Johnathan

jonathanbarrios
jonathanbarrios
Treehouse Teacher

Way to go Alexandra Sophie Coyle πŸŽ‰

Setting the ports to 80 3306 like it says in the video is so you can use localhost without port numbers. Glad you powered through and found a solution that works. I personally like using port numbers because I can simply use 8000 for PHP and 8001 for Laravel, etc...

Happy coding! πŸ™Œ

Same issue and only worked by switching back the port as well.

jonathanbarrios
STAFF
jonathanbarrios
Treehouse Teacher

Hi πŸ‘‹πŸΌ Marston Gould,

Did you get it sorted out?