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 Build a Simple PHP Application Creating the Menu and Footer Starting the Project

can't display LOCALHOST files nor INDEX.php with MAMP (Apache)

At first, the local host didn't display files but the browser could detect index.html. After renaming it to INDEX.php, only got a white page from the browser. Been using MAMP v. 3.0.7.3 (loading Apache and MySQL)

simhub
simhub
26,544 Points

if you already add php code like - "<p>© <?php echo date('Y'); ?> 2012 Shirts 4 Mike</p>" on to the page it could be a syntax error you ran into. Something like a missing php end tag "?>".

2 Answers

Throw this at the very top of your script - before anything else:

<?php

error_reporting(-1);
ini_set('display_errors', 'On');

You should get some error messages back. If so, what do they say?

Thanks! This command is helping me solve several problems in my code! :)