dibaliklayar

Wednesday, February 15, 2006

Installing php 5 in RHEL 4

The RHEL is fresh install with no php4 installed. only Apache 2 that come in the CD is installed. this is 32bit system, I have to try this at 64 bit system if anyone donate 64bit machine.
I couldn't get any rpm for RHEL get the php5 source RPM for CentOS 4.2. You'll find it in the centosplus directory on any of the CentOS mirror. I think this is the closest src for RHEL.

After I get the file what I will use the default src from the rpm and you must make sure that below package is installed. if not, install them first:

bzip2-devel curl-devel db4-devel expat-devel gmp-devel aspell-devel httpd-devel libjpeg-devel libpng-devel pam-devel libstdc++-devel openssl-devel zlib-devel pcre-devel libtool gcc-c++ elfutils-libelf-devel krb5-devel libc-client-devel cyrus-sasl-devel openldap-devel rh-postgresql-devel unixODBC-devel libxml2-devel net-snmp-devel libxslt-devel libxml2-devel ncurses-devel gd-devel freetype-devel

do this to check the package:
root@local~>rpm -q httpd-devel
root@local~>rpm -q bzip2-devel
root@local~>rpm -q curl-devel
root@local~>rpm -q db4-devel
root@local~>rpm -q expat-devel
root@local~>rpm -q gmp-devel
root@local~>rpm -q aspell-devel
root@local~>rpm -q httpd-devel
root@local~>rpm -q libjpeg-devel
root@local~>rpm -q libpng-devel
root@local~>rpm -q pam-devel
root@local~>rpm -q libstdc++-devel
root@local~>rpm -q openssl-devel
root@local~>rpm -q zlib-devel
root@local~>rpm -q pcre-devel
root@local~>rpm -q libtool
root@local~>rpm -q gcc-c++
root@local~>rpm -q elfutils-libelf-devel
root@local~>rpm -q krb5-devel
root@local~>rpm -q libc-client-devel
root@local~>rpm -q cyrus-sasl-devel
root@local~>rpm -q openldap-devel
root@local~>rpm -q rh-postgresql-devel
root@local~>rpm -q unixODBC-devel
root@local~>rpm -q libxml2-devel
root@local~>rpm -q net-snmp-devel
root@local~>rpm -q libxslt-devel
root@local~>rpm -q libxml2-devel
root@local~>rpm -q ncurses-devel
root@local~>rpm -q gd-devel
root@local~>rpm -q freetype-devel

make sure you have apxs:

root@local~>locate apxs

after all set then :
root@local~>rpmbuild --rebuild php-5.0.4-5.centos4.src.rpm

It takes along time in my machine so sit back and get a drink.
when its done all the rpm for RHEL is ready to install at
/usr/src/redhat/RPMS/i386/

now you can install it with you favorite installer.

once it is done, edit php.ini;
make surre that;

extension_dir = /usr/lib/php/modules

and configure php.ini further to your preference of php.

add this line in /etc/httpd/conf/php.conf

LoadModule php5_module modules/libphp5.so

restart the apache and you should good to go.

in my case I have to re create the SSL cert and key. I am not sure why it changed after installing php? but I recreate them anyway and restart my apache.

tesing RHEL 4 + PHP 5 and MYSQL 5 with phpmyadmin.....

run smootthhhhhhhhhhhh....
:)

1 Comments:

At 2:40 AM, Blogger jyothirmayee said...

this was really very useful and solves all the "not found/missing" problems faced while installing php5.

One would also need libmcrypt-devel

$rpm -q libmcrypt-devel

Alternatively one can resolve most dependencies by
1. For all (.a|.so) missing
i) $ up2date package_name
ii) If reported as still missing, check the location the file could be something like /usr/lib/libmcrypt.so.4.4.7
create a sym link to plain .so without version numbers
$ ln -s /usr/lib/libmcrypt.so.4.4.7 /usr/lib/libmcrypt.so

And the problem should be solved

2. If a .h is reported as missing, find the package responsible and install the devel version
$ up2date package_name-devel

 

Post a Comment

<< Home