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

PHP,Apache, and MySQL installation MAMP

Hello,

I've installed the basic package of MAMP for PHP and MySQL on my Windows 7 PC. The Apache and SQL servers have green lights. When I create the test file and put in some php code then run it, it does not appear in my web browser(firefox). When I put in basic html/css code in the test file it shows up fine in the browser. I'm even using easy syntax to make sure it's nothing with the code I did <?php echo "Hello"; ?> and that does not show up at all. I just get a blank webpage. Any help on this would be great. Thank you!

What address are you visiting in your browser? It should be something along the lines of http://localhost/foldername or 127.0.0.1/foldername.

Thanks

4 Answers

When, I preview the file this is the path it shows file:///C:/MAMP/htdocs/test.php. Any suggestions on how I can get it to show the correct address?

Please try loading http://localhost/test.php and see if that works

Okay, I'm using Aptana studio 3. I'm new to this type of editor. Is there anything I need to do so that the file has http://localhost? I can't just put it in the address it self. I get a 404 error.

andi mitre
STAFF
andi mitre
Treehouse Guest Teacher

Not familiar with Aptana studio but when you start MAMP and get the two green lights that means that your local server is up and running. However your test.php file has to be in the directory which the apache server is running on. For MAMP the default document root c:\MAMP\htdocs is equivalent to http://localhost:8888 in your browser. Add /test.php to the end of the url after adding the file to the default document root on MAMP.

cheers