Click to See Complete Forum and Search --> : PHP5 and displaying scripts inside .html files


gnorman
01-01-2005, 03:03 AM
Hello, Here is the problem I have, after a rocky install, I got the phpinfo() to work showing the php info in my browser, but when I embed php code inside html it fails,
when I bring up the web page in my browser, I using Apache 2.0, PHP 5.03, mysql, here is the code

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>hello this a test</title>
</head>

<body>

<p>hello this a test</p>
<h1>
<?php print "Hello World"; ?>
</h1>

</body>

</html>

Only the hello this a test displays

Thanks for any help....

Installer
01-02-2005, 11:26 AM
You probably either aren't using the ".php" extension on your file, or you don't have Apache configured to parse such a file. Look in "httpd.conf" for the line "AddType application/x-httpd-php .php" and add it if it's not there. Also you can add the line "AddType application/x-httpd-php .html" and any file with the ".html" extension that contains PHP will be correctly parsed.

gnorman
01-02-2005, 06:33 PM
Thanks alot, have a nice day