Apache httpd 2.0.54 & php 4.4.0 install under redhat 9

Apache httpd 2.0.54 & php 4.4.0 install under redhat 9
0 votes, 0.00 avg. rating (0% score)

Pleas note that this article orginially written about 1 year ago.

I spent 2 days installing Apach 2.0.54 & php 4.4.0. under redhat 9.

The main reason was to implement GD2 functions in PHP.
And to install the softwares using rpms as much as possible.

I know. It was a pain.

Before you’re doing anything copy existing config files

$>cp -r /etc/httpd /etc/httpd.backup
$>cp  /etc/php.ini /etc/php.ini.backup
$>cp -r /etc/php.d /etc/php.d.backup

Also , find a fast redhat 9 rpm download site.
You will need to download & install bunch of rpms if you haven’t.

First I downloaded httpd-2.0.54.tar.gz from apache.org website.
And I realized that there is a .spec file. It means that you can use rpmbuild command to compile & install it.

so…

I unzipped & untarred httpd-2.0.54.tar.gz

Also, had to copy httpd-2.0.54.tar.gz in /usr/src/redhat/SOURCES

Then I chdir into the untarred directory & ran

$> rpmbuild -bb httpd.spec

Then it prompted me lots of dependent rpm packages.
Some of them I was lucky that I found rpm packages from rpmfind.net
But, I had to compile few of the packages manually.

Anyway, I used –nodeps option when running found rpm packages.
It worked anyway.

by running -e option you need to uninstall previous default httpd version

$> rpm -e httpd-2.0.40-21
$> rpm -e httpd-devel-2.0.40-21
$> rpm -e httpd-manual-2.0.40-21

and chdir into /usr/src/redhat/RPMS/i386

You will see 3 rpms. You need to install at least 2 rpms.

$> rpm -Uvh httpd-2.0.54-1.i386.rpm
$> rpm -Uvh httpd-devel-2.0.54-1.i386.rpm

For the php, I downloaded the lastest PHP 4 package. I wanted PHP4 since I felt like PHP5 might cause more problem during the installation.

I’ve got the configure lines by creating a test php page and inserted phpinfo() function. When you visit this test php page with the browser, I will be able to find the configure command used to compile the current PHP .

I have used this command to configure my new 4.4.0 package.

But during the steps the options reduced down to below

'./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' \
	'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' \
	'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' \
	'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' \
	'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' \
	'--sharedstatedir=/usr/com' '--mandir=/usr/share/man' \
	'--infodir=/usr/share/info' '--cache-file=../config.cache' \
	'--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'\
	'--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' \
	'--disable-rpath' '--enable-inline-optimization' '--with-bz2' \
	'--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' \
	'--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' \ 
	'--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' \
	'--with-gettext' '--with-ncurses' '--with-gmp' \
	'--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' \
	'--with-pspell' '--with-regex=system' '--with-xml' \
	'--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' \
	'--enable-bcmath' '--enable-exif' '--enable-ftp' \
	'--enable-magic-quotes' '--enable-safe-mode' \
	'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' \
	'--enable-discard-path' '--enable-track-vars' \
	'--enable-trans-sid' '--enable-yp' '--enable-wddx' \
	'--without-oci8' '--with-pear=/usr/share/pear' \
	'--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' \
	'--with-ldap=shared' '--with-mysql=shared,/usr' '--with-unixODBC=shared' \
	'--enable-memory-limit' '--enable-bcmath' '--enable-shmop' \
	'--enable-versioning' '--enable-calendar' '--enable-dbx' \
	'--enable-dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs' \
	'--with-mhash'

I needed those ‘–with-mhash’ for some personal reason.

then I ran

$>make
$>make install

Now chdir into modules directory & copy all .so files into /usr/lib/php4.

$>cp *.so /usr/lib/php4

You need to manually copy the php.ini-dist into the /etc directory.
Also you might want to modify the php.ini comparing with the backedup php.ini file if you have customized the previous version php.ini file.

Especially make sure you insert the

extension_dir = "/usr/lib/php4"

in the new php.ini.

Leave a Reply

Your email address will not be published. Required fields are marked *