5

我试图找到一种简单的方法来升级我的 CentOS5 机器上的 PHP,yum而不是下载源代码并自己重新编译(我上次做过,但是很难让所有编译配置都与 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

我认为这基本上意味着我需要重新编译这四个模块,我该怎么做?任何建议表示赞赏。

4

7 回答 7

1

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

一个例子是here。


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 和其他扩展。有用!!

于 2011-03-10T10:29:59.437 回答
0

尝试

pecl install fileinfo readline memcache

这应该可以解决问题。

于 2010-04-13T08:01:50.230 回答
0

我关注了一个 CentOS wiki,了解如何使用测试存储库升级 PHP: http ://wiki.centos.org/HowTos/PHP_5.1_To_5.2

我收到了 fileinfo 和 memcache 的错误,所以我尝试了:

pecl install fileinfo memcache

...所有警告都消失了。

于 2010-11-15T08:28:23.860 回答
0

PHP 不是一次性安装的,它是模块化的。所以你有一些你列出的东西,它们是为不同版本的 PHP 设计的。您将需要为您安装的 PHP 版本安装所有用于实现的插件。

简短的回答,如果你想要一个真正最新的 PHP 版本,不要使用 CentOS。这只是一种痛苦。CentOS 是关于稳定性,而不是尖端软件。使用 Ubuntu 或 Debian。

长答案,您最好的选择是从源代码编译或找到提供 PHP 5.1.whatyouneed 的存储库。我建议不要使用存储库,除非您非常确定它来自有信誉的来源。

如果我要这样做,我会从源代码编译 PHP。这是一个帮助您入门的链接:http ://www.wolflabs.org/2008/12/08/installing-php-from-source-on-centos-x86_64-w-apache/

于 2010-02-05T22:46:06.377 回答
0

这是我用来在 CentOS 5 上升级 PHP 的 repo 配置(在文本中查找 Enterprise Linux 5) http://blog.famillecollet.com/pages/Config-en

于 2010-02-05T23:01:13.827 回答
0

您应该获取SRPM,替换 tarball,然后重新构建它。如果您需要任何东西,您可能还想获取“附加”SRPM 。

于 2010-02-05T22:56:00.500 回答
0

pecl install memcache

为我运行 Centos 5.5 工作

于 2010-08-08T18:53:58.380 回答