After four days of searching the Web for answers, I finally managed to get all the above components working together. This wasn't an easy feat given that I'm a Linux newbie at best.
I used a hack* to get them working together. Since I just want to play around with the above components and not actually use it on a live server I figured it'd be okay for now until proper fixes are released.
I wouldn't suggest using this guide if you wish to preserve your current setup since it needs you to remove any current installations of Apache, MySQL and PHP.
==========
SOFTWARE
- RedHat 8.0 (already installed)
- Apache 2.0.45 (source)
- httpd-devel-2.0.40-8.i386.rpm
- MySQL 4.0.12 (RPMs)
- PHP 4.3.1 (source)
=====
SETUP
- Uninstall Apache, MySQL and PHP RPMs, which, in my case, were included during RedHat installation.
Note: Apache had several package dependencies such as mod_perl, mod_python, mod_ssl, and httpd-devel. I don't need them at the moment, so I just uninstalled them too. Anyway, I could (hopefully) add them in the future.
- Install the MySQL RPMs: client, server, embedded, share, devel, and bench
- Install Apache.
./configure --prefix=/usr/lib/httpd --enable-mods-shared=all
make
make install
- Install httpd-devel-2.0.40-8.i386.rpm
rpm -ivh httpd-devel-2.0.40-8.i386.rpm
Note: I didn't have apxs installed, which is contained in httpd-devel. As far as I know, apxs is needed to install PHP as a shared object in Apache.
- Install PHP.
In ${PHP_SOURCE_DIR}/sapi/apache2filter/php_functions.c remove the following lines:-
#if MODULE_MAGIC_NUMBER < 20020506
ADD_STRING(boundary);
#endif
./configure --with-apxs2 --with-mysql=/usr
make
make install
- Customise startup scripts.
In /usr/lib/httpd/conf/httpd.conf add the following lines:-
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php
In /etc/php.ini add or uncomment the following line:
extension=mysql.so
==========
FOOTNOTE
*Kudos to efactory's LAMPS tutorial (http://lamps.efactory.de/e-lamps-2-0-0.shtml#inst-php), for the php_functions.c hack