Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Basic PHP Website Building a Media Library in PHP Using PHP Code on Our Site

MAMP won't open .php file

Please excuse the terminology, I'm new to servers and php but will try my best to be clear. When I downloaded the latest version of MAMP and ran it on the latest version of Windows, I initially had an issue that was resolved by changing the standard version to 7.2.14 - as recommended by someone.

When I save files in C:\MAMP\htdocs it opens .html and .php without any issues. I use dropbox to store my coding files so they are always backed up and when I change the document root to a different folder it will load index.html but as soon as I change it to index.php it shows a blank page. What am I doing wrong here? I moved it to a folder on my desktop and had the same issue. When I put it all into htdocs it works again. I'm sure this is embarassingly simple to resolve. For now I am just practicing in C:\MAMP\htdocs. Thanks!

1 Answer

Yo, just working through this course for some revision and saw your Q... If this is still an issue, or if future students have this issue, check your port settings in MAMP ("MAMP"/Preferences/Ports). I had the same issue, but setting these to 8888 and using the URL http://localhost:8888/ instead for local development fixed this. Hope that helps someone!