tags:

views:

28

answers:

2

I've been writing php apps using php for a while in wamp. Now I'm installing PHP & apache separately on my work PC. I've installed PHP 5, and the latest apache. I go to localhost and see it works! now I add a file called test.php which displays:

<?php 
    phpinfo();
?>

but in the browser it just displays plain text. Is there somewhere I have explicitly tell it to use PHP5?

Thanks a lot

+3  A: 

You'll need to add this to your server configuration:

AddType application/x-httpd-php .php

that is assuming you have installed php properly, which may not be the case since it doesn't work where it normally would immediately after installing.

It is entirely possible that you'll also have to add the php so/dll to your apache config using a LoadModule directive (usually in httpd.conf)

Kris
+1  A: 

You need to configure Apache (the webserver) to process PHP scripts as PHP. Check Apache's config, you need to load the module (the path may differ on your system):

LoadModule php5_module "c:/php/php5apache.dll"

and you also need to tell Apache what to process with PHP:

AddType application/x-httpd-php .php

See the documentation for more details.

Piskvor
thanks for your reply. The php5apache.dll file does not exist in my PHP directory. Is it always called php5apache?
iamjonesy