Click to See Complete Forum and Search --> : Get it working: Apache 2.039/PHP 4.2.1


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

Anon
07-17-2002, 10:15 PM
thank you very much. this was very helpful!

Anon
07-27-2002, 06:05 AM
AWESOME! Thanks so much!

sirarker
07-28-2002, 09:06 AM
If your system is WinXP,note:
If you cannot post your varibles in a form
through $_POST,try add these items after
LoadModule .... ../sapi/php4apache2.dll


<FilesMatch "\.php$">
SetOutputFilter PHP
SetInputFilter PHP
</FilesMatch>

Anon
08-03-2002, 06:37 PM
I have followed Witold Iwaniec's instructions.But now the Apache server won't even start. It just flashs. And nothing happens. Could someone send me there Httpd.conf and Php.ini and tell me where to put them. Im only 15 and not to good with php. Good at other things like HTML :-). Thanks

R.Gibson