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
Paul Ozag
11,369 Pointscan't figure out why xampp isn't executing php commands
hey - just started php course -- i know next to nothing about xampp or server side programming. i got xampp up and running and set up a test.php file in my htdocs folder. here it is:
<!DOCTYPE html>
<html>
<head>
<title>Shirts 4 Mike</title>
</head>
<body>
<h1>Shirts 4 Mike</h1>
<p>© <?php echo date('Y'); ?> Shirts 4 Mike</p>
<?php echo 'this is a test'; ?>
</body>
</html>
unless my php code is incorrect, it seems like none of the php code is being executed. neither the date nor the test string are making it out to the page, though the rest of the html displays as it should. i double checked and the file extension is definitely '.php'
don't know enough of xampp innards to try and see what is going on -- any advice?
umm for some reason when i cut and paste the code from sublime it displayed kinda weird here in the post... the two lines of code involving php are:
<p>© <?php echo date('Y'); ?> Shirts 4 Mike</p>
<?php echo 'this is a test'; ?>
** i can't get the displayed code to appear verbatim as it does in my (sublime) editor
1 Answer
Glen Burnett
Courses Plus Student 27,349 PointsHi Paul
Your code looks ok I can't see any issues with it. It may be how you have your xampp configured/set up, particularly if you say it's showing your html code but not outputting the php stuff.
I realise this answer comes 11 months later so I am hoping you got your issue sorted out.
I'm sure other forum readers might be interested to know what it was if you have since solved your issue
Happy coding!