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

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?