Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange PHP problem

Status
Not open for further replies.

cyoung

Programmer
Oct 31, 2001
188
US
I am running PHP on Apache (Linux) and I have the following issue.

When I run the following (as phpinfo.php) it works fine
<?PHP
phpinfo();
?>

When I try to include it in an html page, it shows the PHP code and does not render

(test.html)
<?PHP
include("phpinfo.php");
?>

Any ideas?

Thanks!
 
because web servers, by default, do not send html and htm output to the php hypertext preprocessor. they only send files ending php (or similar).

you can change this behaviour if you need.
 
I changed the php handler to include .html files and I still have the issue.

The situation is that I have been asked to add some form handling to an existing page, and I was hoping that I could just drop the PHP into the existing page.

Thanks!
 
jpadie is correct you need HTML to parse PHP
and it is done via HTTPD.conf

You may also try
via a .htaccess file with:
AddType application/x-httpd-php .php .html
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top