Last Updated: February 25, 2016
·
14.64K
· wajatimur

Installing PHP 5.4 on RHEL 6.3 Using REMI Repo

With a fresh installation you might encounter a dependency problem on installing LAMP stack on RHEL 6. Below command should install the Apache2, PHP 5.4 and MySql server on RHEL, i will not elaborate the detail configuration because there's a number of tutorial available online.

# Installing REMI repository
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

# Installing LAMP stack
yum --enablerepo=remi install httpd mysql mysql-server php php-common

Under some circumstances we might bugged with dependency problem on YUM command with some RHEL installation due to incompatible library provided by installed packages previously.

--> Finished Dependency Resolution
Error: Package: php-5.4.28-1.el6.remi.x86_64 (remi)
           Requires: libssl.so.10(libssl.so.10)(64bit)
Error: Package: php-5.4.28-1.el6.remi.x86_64 (remi)
           Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: php-cli-5.4.28-1.el6.remi.x86_64 (remi)
           Requires: libcrypto.so.10(libcrypto.so.10)(64bit)
Error: Package: php-5.4.28-1.el6.remi.x86_64 (remi)
           Requires: libcrypto.so.10(OPENSSL_1.0.1)(64bit)
Error: Package: php-cli-5.4.28-1.el6.remi.x86_64 (remi)
           Requires: libcrypto.so.10(OPENSSL_1.0.1)(64bit)
Error: Package: php-cli-5.4.28-1.el6.remi.x86_64 (remi)
           Requires: libssl.so.10(libssl.so.10)(64bit)
Error: Package: php-5.4.28-1.el6.remi.x86_64 (remi)
           Requires: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit)
Error: Package: php-cli-5.4.28-1.el6.remi.x86_64 (remi)
           Requires: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

# Warning! This output is truncated, real output might be longer.

This problem can be solve by installing the correct library from Centos rpm package or others related repository. Below package were required based on my installation RHEL 6.3 (Santiago), others might be different. Timely package might be upgrade and removed from repository this will cause to link unavailable to download.

yum install http://mirror.centos.org/centos/6/os/x86_64/Packages/openssl-1.0.1e-15.el6.x86_64.rpm
yum install http://mirror.centos.org/centos/6/os/x86_64/Packages/zlib-1.2.3-29.el6.x86_64.rpm

The key point to search correct library is by getting the last required library on the error output, based on the example above the library you should be looking for is libcrypto.so.10(OPENSSL_1.0.1_EC) and to get which package provide the library is by running below command.

yum whatprovides "*/libcrypto.so.10"

YUM will response with the list of package name which provide the library file. To verified that the package installed provide the correct library required by the problematic LAMP installation you can by running below command

rpm -q --provides openssl