For the archives, here's how I got Apache 2 and PHP working together on Linux
(RedHat 7.3). For future Apache versions, make sure you choose a version of
Apache released BEFORE the php release. Using an Apache 2 released after a
PHP will probably not work.
I was only able to get PHP working with Apache 2 as a DSO.
I think that's the only way that's supported now.
I used httpd-2.0.43 and php-4.3.0-dev (php4-200210181200)
(from http://snaps.php.net/php4-latest.tar.gz )
php-4.3.0pre1 mostly worked, but my messages with Phorum (PHP app) were garbled
(probably a php/mysql bug).
I'm sure that fix will appear in the next prerelease of php-4.3.0 (pre2?).
0. Download/unpack Apache2 source.
1. In the Apache 2 source directory, type:
./configure --prefix=/usr/local/apache \
2. If successful, install, as root:
3. In the php source directory, type:
5. If successful, type, as root: make install-su
4. cp -p php.ini-recommended /usr/local/apache/php/php.ini
5. Make sure libs/libphp4.so is in /usr/local/apache/modules/
If not, copy it there)
6. Verify (and add if missing) these directives in
# Make sure there's only **1** line with this directive:
LoadModule php4_module modules/libphp4.so
# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php
AddType application/x-httpd-php php
7. Start httpd:
8. Sanity checks:
ps -ef |grep httpd
9. Access your webserver with your favorite browser.