Page 1 of 1

Configuration issues with PHP and Apache

Posted: Wed Nov 05, 2003 3:19 pm
by sachin007_bond
I am having some problems configuring Apache(v1.3.28) and PHP(v4.3.4). I am trying to do this on WIN XP. The following are entries I added in the 'httpd.conf' file in Apache:

ScriptAlias /php4/ "C:/php4/"

AddType application/x-httpd-php .phtml .php
AddType application/x-httpd-php-source .phps

Action application/x-httpd-php /php4/php.exe


I have also renamed 'php.ini-dist' to 'php.ini' and moved it across to C:\Windows. Also, 'msvcrt.dll' and 'php4ts.dll' have been moved to 'C:\WINDOWS\SYSTEM''.

After this I tried creating a new php file called 'phpinfo.php' in the htdocs directory of Apache, with the following code:

<? phpinfo() ?>

Now that I try and open this page in Internet Explorer, it says 'Page cannot be found'. Is this a known issue with PHP because Apache's home page works fine. Its only the php files that fail to open.

Can anyone help.

Thanks.

Posted: Wed Nov 05, 2003 3:33 pm
by JAM
I use the module.

Code: Select all

LoadModule php4_module "C:/PHP/sapi/php4apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
...instead of scriptalias (CGI version).
If you for some reason do not want to use the module, try adding
double quotes around /php/php.exe.

LoadModule is however recommended.