php executing as html

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
blackdub
Forum Newbie
Posts: 1
Joined: Tue Feb 08, 2011 6:32 am

php executing as html

Post by blackdub »

Hello

I just finished the installs of php, mysql and apache (with success). Now, I want to see the result of my first phpcode in firefox but apparently it is executed as html. I'm sure there is nothing wrong with the code, because I took it from my text-book. Can anyone help me to solve this problem?

Thanks
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: php executing as html

Post by Jade »

Make sure you have php tags around your php and that it's in a file with a .php extension.

Test.php file would have this inside:

Code: Select all

<?php
echo "hey there";
?>
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: php executing as html

Post by Doug G »

You have to put your php file in a web directory and call it through a url like http://localhost/myphpfile.php
Post Reply