首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在CentOS上使用yum将PHP升级到5.2.12

在CentOS上使用yum将PHP升级到5.2.12
EN

Stack Overflow用户
提问于 2010-02-06 06:33:11
回答 7查看 8.7K关注 0票数 5

我试图找到一种简单的方法来使用yum在我的CentOS5机器上升级PHP,而不是下载源代码并自己重新编译(我上次就这样做了,但真的很难获得与CentOS的默认配置相同的所有编译配置)。无论如何,我最终使用了下面列出的方法:http://www.atomicorp.com/wiki/index.php/PHP

现在,命令php -v显示版本已经是5.2.11 (这是我需要的),但它总是包含许多警告,比如:

代码语言:javascript
复制
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

我想这基本上意味着我需要重新编译这四个模块,我该怎么做呢?如有任何建议,欢迎光临。

EN

回答 7

Stack Overflow用户

发布于 2011-03-10 18:29:59

这真的很简单,您需要添加更多最新的yum存储库,然后升级。

这里有一个例子。

代码语言:javascript
复制
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和其他扩展。它成功了!!

票数 1
EN

Stack Overflow用户

发布于 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/

票数 0
EN

Stack Overflow用户

发布于 2010-02-06 06:56:01

您应该获取the SRPM,替换tarball,然后重新构建它。如果您需要从the "extras" SRPM获取任何东西,您可能也想要获取它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2210933

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档