我试图找到一种简单的方法来使用yum在我的CentOS5机器上升级PHP,而不是下载源代码并自己重新编译(我上次就这样做了,但真的很难获得与CentOS的默认配置相同的所有编译配置)。无论如何,我最终使用了下面列出的方法:http://www.atomicorp.com/wiki/index.php/PHP
现在,命令php -v显示版本已经是5.2.11 (这是我需要的),但它总是包含许多警告,比如:
PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mssql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0我想这基本上意味着我需要重新编译这四个模块,我该怎么做呢?如有任何建议,欢迎光临。
发布于 2011-03-10 18:29:59
这真的很简单,您需要添加更多最新的yum存储库,然后升级。
这里有一个例子。
cat >> /etc/yum.repos.d/utterramblings.repo <<END
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL5/i386/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka在此之后,您将获得最新版本的php和其他扩展。它成功了!!
发布于 2010-02-06 06:46:06
PHP不是一次性安装的,它是模块化的。因此,您拥有的内容就像您列出的那样,是为不同版本的PHP设计的。对于已安装的PHP版本,您需要安装用于实现的所有插件。
简而言之,如果你想要一个最新的PHP版本,不要使用CentOS。这只是一种痛苦。CentOS是关于稳定性的,而不是尖端的软件。使用Ubuntu或Debian。
长话短说,你最好的选择无疑是从源代码编译,或者找到一个提供PHP5.1的存储库。我建议不要使用存储库,除非您非常确定它来自一个声誉良好的来源。
如果我要这样做,我会从源代码编译PHP。这里有一个帮助您入门的链接:http://www.wolflabs.org/2008/12/08/installing-php-from-source-on-centos-x86_64-w-apache/
发布于 2010-02-06 06:56:01
您应该获取the SRPM,替换tarball,然后重新构建它。如果您需要从the "extras" SRPM获取任何东西,您可能也想要获取它。
https://stackoverflow.com/questions/2210933
复制相似问题