Danish Khan Danish Khan - 5 months ago 32
PHP Question

How to upgrade PHP 5.1 to higher version in CentOS 5.x

I just bought a new host from databasemart.com but the problem is that I installed wordpress and the PHP version on VPS is 5.1 but wordpress needs at least 5.2.4. I spent straight 6 hours to fix this but nothing helped. Any idea?

EDIT: I just don't get it.. This is what I see in ssh:

php -v
PHP 5.3.3 (cli) (built: Jun 9 2016 18:22:38)
Copyright (c) 1997-2010 The PHP Group


but on the other side.. This is what I see when I open my website:


Your server is running PHP version 5.1.6 but WordPress 4.1.5 requires
at least 5.2.4.


EDIT2: I tried installing mirror 5.4 and this is what I get:

yum install php-5.4.16-36.el7_1.x86_64.rpm

Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: centos.host-engine.com
* epel: fedora-epel.mirror.lstn.net
* extras: yum.tamu.edu
* updates: mirror.team-cymru.org
Setting up Install Process
Examining php-5.4.16-36.el7_1.x86_64.rpm: php-5.4.16-36.el7_1.x86_64
Marking php-5.4.16-36.el7_1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.4.16-36.el7_1 set to be updated
--> Processing Dependency: httpd-mmn = 20120211x8664 for package: php
--> Processing Dependency: php-common(x86-64) = 5.4.16-36.el7_1 for package: php
--> Processing Dependency: php-cli(x86-64) = 5.4.16-36.el7_1 for package: php
--> Processing Dependency: libcrypto.so.10(libcrypto.so.10)(64bit) for package: php
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.1)(64bit) for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.11)(64bit) for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.14)(64bit) for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.15)(64bit) for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.7)(64bit) for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.8)(64bit) for package: php
--> Processing Dependency: libssl.so.10(libssl.so.10)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.4.30)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.5.2)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.6.0)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.6.11)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.6.5)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.9.0)(64bit) for package: php
--> Processing Dependency: libcrypto.so.10()(64bit) for package: php
--> Processing Dependency: libgmp.so.10()(64bit) for package: php
--> Processing Dependency: libpcre.so.1()(64bit) for package: php
--> Processing Dependency: libssl.so.10()(64bit) for package: php
--> Running transaction check
---> Package openssl101e.x86_64 0:1.0.1e-8.el5 set to be updated
---> Package php.x86_64 0:5.4.16-36.el7_1 set to be updated
--> Processing Dependency: httpd-mmn = 20120211x8664 for package: php
--> Processing Dependency: php-common(x86-64) = 5.4.16-36.el7_1 for package: php
--> Processing Dependency: php-cli(x86-64) = 5.4.16-36.el7_1 for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.11)(64bit) for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.14)(64bit) for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.15)(64bit) for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.7)(64bit) for package: php
--> Processing Dependency: libc.so.6(GLIBC_2.8)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.4.30)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.5.2)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.6.0)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.6.11)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.6.5)(64bit) for package: php
--> Processing Dependency: libxml2.so.2(LIBXML2_2.9.0)(64bit) for package: php
--> Processing Dependency: libgmp.so.10()(64bit) for package: php
--> Processing Dependency: libpcre.so.1()(64bit) for package: php
--> Finished Dependency Resolution
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libxml2.so.2(LIBXML2_2.9.0)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libxml2.so.2(LIBXML2_2.6.5)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libxml2.so.2(LIBXML2_2.6.0)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libc.so.6(GLIBC_2.14)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libxml2.so.2(LIBXML2_2.5.2)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libxml2.so.2(LIBXML2_2.4.30)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libxml2.so.2(LIBXML2_2.6.11)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libpcre.so.1()(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libc.so.6(GLIBC_2.8)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: php-cli(x86-64) = 5.4.16-36.el7_1 is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libc.so.6(GLIBC_2.7)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: php-common(x86-64) = 5.4.16-36.el7_1 is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: httpd-mmn = 20120211x8664 is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libc.so.6(GLIBC_2.11)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libgmp.so.10()(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
php-5.4.16-36.el7_1.x86_64 from /php-5.4.16-36.el7_1.x86_64 has depsolving problems
--> Missing Dependency: libc.so.6(GLIBC_2.15)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libxml2.so.2(LIBXML2_2.6.0)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libxml2.so.2(LIBXML2_2.5.2)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libgmp.so.10()(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libxml2.so.2(LIBXML2_2.6.11)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libc.so.6(GLIBC_2.15)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libc.so.6(GLIBC_2.8)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: php-common(x86-64) = 5.4.16-36.el7_1 is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libpcre.so.1()(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libxml2.so.2(LIBXML2_2.4.30)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: php-cli(x86-64) = 5.4.16-36.el7_1 is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: httpd-mmn = 20120211x8664 is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libxml2.so.2(LIBXML2_2.9.0)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libc.so.6(GLIBC_2.14)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libxml2.so.2(LIBXML2_2.6.5)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libc.so.6(GLIBC_2.11)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
Error: Missing Dependency: libc.so.6(GLIBC_2.7)(64bit) is needed by package php-5.4.16-36.el7_1.x86_64 (/php-5.4.16-36.el7_1.x86_64)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.

Answer

I feel embarrassed. My host told me that I have CentOS 7.x but I wanted to confirm and when I checked it, it was centos-release-5-11.el5.centos

I followed this tutorial: https://www.joeferguson.me/installing-php-5-6-x-on-centos-5-11/

ALSO do not forget to restart httpd service service httpd restart after installing packages.

Problem is fixed. Thanks a lot for your help guys. I couldn't have done it without you. :)

Comments