wiwaniec
07-03-2002, 01:34 AM
Hi
It seems that many people go through the same that I experienced - problems with getting PHP 4.2.1 working with Apache 2.039. Some people responded how to get it to work. I tried different options recommended by others and when I got it to work I thought I may put it all together in one posting. I learned from postings on this forum as well as from "User Contributed Notes" on http://www.php.net/manual/en/install.apache.php - thanks Fanny ZHU for the link.
I have it working on Windows 2000 and have used the binaries only.
1. Install Apache 2.039
2. Get PHP from http://snaps.php.net/win32
(thanks kristijan for the link) - I used the php4_win32_latest.zip
3. Unzip the PHP
4. Get php4apache2.dll from http://insodus.servehttp.com/Exosoft/_downloads/php4apache2.dll (thanks insodus@hotmail.com) and replace the original php4apache2.dll in ..\php\sapi
5. Follow install.txt - create php.ini in %SYSTEMROOT% directory and make the edits
6. Follow install.txt and edit httpd.config but add only the two lines:
LoadModule php4_module c:/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php
DO NOT add:
AddModule mod_php4.c
When I added the line Apache didn't start. It displayed error:
Invalid command 'AddModule', perhaps mis-spelled or defined by a module not included in the server configuration
And there may be a reason - the compile.log on http://snaps.php.net/win32 doesn't list mod_php4.c in the list of modules in php4apache2.dll (it is listed in php4apache.dll only)
7. At this point you should be able to use php files stored in Apache DocumentRoot directory. For some reason I could not use files from subdirectories of the DocumentRoot. If you set up virtual directories, you can use php files stored there and in subdirectories
I hope my typing will save someone some time
Witold
It seems that many people go through the same that I experienced - problems with getting PHP 4.2.1 working with Apache 2.039. Some people responded how to get it to work. I tried different options recommended by others and when I got it to work I thought I may put it all together in one posting. I learned from postings on this forum as well as from "User Contributed Notes" on http://www.php.net/manual/en/install.apache.php - thanks Fanny ZHU for the link.
I have it working on Windows 2000 and have used the binaries only.
1. Install Apache 2.039
2. Get PHP from http://snaps.php.net/win32
(thanks kristijan for the link) - I used the php4_win32_latest.zip
3. Unzip the PHP
4. Get php4apache2.dll from http://insodus.servehttp.com/Exosoft/_downloads/php4apache2.dll (thanks insodus@hotmail.com) and replace the original php4apache2.dll in ..\php\sapi
5. Follow install.txt - create php.ini in %SYSTEMROOT% directory and make the edits
6. Follow install.txt and edit httpd.config but add only the two lines:
LoadModule php4_module c:/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php
DO NOT add:
AddModule mod_php4.c
When I added the line Apache didn't start. It displayed error:
Invalid command 'AddModule', perhaps mis-spelled or defined by a module not included in the server configuration
And there may be a reason - the compile.log on http://snaps.php.net/win32 doesn't list mod_php4.c in the list of modules in php4apache2.dll (it is listed in php4apache.dll only)
7. At this point you should be able to use php files stored in Apache DocumentRoot directory. For some reason I could not use files from subdirectories of the DocumentRoot. If you set up virtual directories, you can use php files stored there and in subdirectories
I hope my typing will save someone some time
Witold