Local Apache server will sot serve PHP files

Adam Goodbar AGoodba at CLEMSON.EDU
Sun Jan 1 15:35:15 UTC 2006


> 	In the case of PHP embedded in an html file, the PHP simply does not
> display. I created a file called "test.html", which contains inside the
> PHP code: <? phpinfo(); ?>. I save the file to my /var/www directory,
> and view it in Firefox at localhost. Nothing shows up on screen.
>   
No PHP code will work when it is in a .html file - This is because
apache does not know to parse it, it needs to be in a .php file
> 	In the case of .php scripts, I created a file called index.php and put
> it in its own directory within /var/www. However, when I try to call it,
> I get a message from Firefox which says I am trying to open a "PHTML"
> file, and would I like to save it or open it with another application.
In your apache configuration file, make sure you have the following entries

LoadModule php4_module
DirectoryIndex index.html index.php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20060101/db3fe4ce/attachment.sig>


More information about the ubuntu-users mailing list