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

XAMPP not running

I just started the course Build a Simple PHP App. I'm on the part where you download XAMPP and then create a php tag in an html index to display the current year.

        <h1>Shirts 4 Mike</h1>
    <p>&copy;<?php echo date('Y'); ?> Shirts 4                                           Mike</p>

My html runs, but the php code doesn't execute. In other words, the year doesn't appear in the browser, just the html title.

I restarted the computer after downloading. I also turned off my antivirus program until after the download completed.

Thanks. I appreciate any suggestions offered.

4 Answers

I finally found the answer. For anyone else having this same issue, please follow this link:

https://www.youtube.com/watch?v=YsmMVwz1rlo

It does a wonderful job of explaining the vital information that Team Treehouse somehow manages to exclude.

" I'm on the part where you download XAMPP and then create a php tag in an html index to display the current year."

Your file needs to end with .php, not .html

It does end with php. The exact file name is test.php

I also tried displaying the code using http://localhost/test.php, but that didn't work either.

Did you start Apache from the XAMPP control panel?

No, I didn't. The video didn't mention that at all. It just said to open up the php file in the browser using localhost/test.php.

I'm pretty new to this. Would you mind too much directing me to the Apache cp?