如何在CentOS 5.x中将PHP 5.1升级到更高版本

时间:2016-06-10 08:34:48

标签: php linux centos

我刚从databasemart.com购买了一台新主机,但问题是我安装了wordpress,而VPS上的PHP版本是5.1但是wordpress需要至少5.2.4。我花了6个小时来解决这个问题,但没有任何帮助。有什么想法吗?

编辑:我只是不明白..这就是我在ssh中看到的:

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

但另一方面......这就是我打开网站时看到的内容:

  

您的服务器正在运行PHP 5.1.6版,但WordPress 4.1.5需要   至少5.2.4。

EDIT2:我尝试安装镜像5.4,这就是我得到的:

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.

1 个答案:

答案 0 :(得分:1)

我感到很尴尬。我的主人告诉我,我有CentOS 7.x,但我想确认,当我检查它时,它是centos-release-5-11.el5.centos

我遵循了本教程:https://www.joeferguson.me/installing-php-5-6-x-on-centos-5-11/

安装软件包后,别忘了重新启动httpd服务service httpd restart

问题得到解决。非常感谢你的帮助。没有你,我无法做到。 :)