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 trialCarlos Belnap
4,564 PointsBrowser only displays "The current server time is ."
Using notepad ++, run in chrome and firefox, but does not display title or current time. What's wrong? Did I miss a typo? Save it to the wrong location?
<h1><?php echo "Shirts 4 Mike"; ?></h1>
<p>The current server time is <?php echo date("H:i:s a"); ?>.</p>
1 Answer
Kevin Korte
28,149 PointsAre you running a PHP server on your computer? At a minimum something like Apache, or more than likely a bundle of programs like XAMPP, MAMP, WAMP, or something else? Or are you using workspaces?
I use XAMPP on Windows 7 at work, and when I copy and pasted your code everything showed up. Since you're not seeing any PHP, I'm assuming you don't have a PHP server running. :)
thomascawthorn
22,986 PointsIt sounds like there's a server running.. Otherwise the php output would be showing up too?
Carlos Belnap
4,564 PointsDid not realize I needed to set up a php server, danke. Trying MAMP. Seems easiest to install and comes with python, which I'm curious about. Thanks!
Kevin Korte
28,149 PointsSweet. I use MAMP on my personal Macbook. Been using it for about 2 years. Very easily and reliable.
Chris Jones
9,419 PointsChris Jones
9,419 PointsI would echo Kevin Korte and Tom Cawthorn, I've just copied your code and ran it on my server and its outputting a title and time.
Therefore sounds like, if you are trying to run it locally, either you've not got php installed/configured properly.
How are you accessing it, in the address bar, is it like http://localhost/filename.php, or http://127.0.0.1, or file file:///C:/path/to/here/filename.html
if the latter, then its not even being parsed by PHP, although I would expect that to still give you some output in your browser.