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

Wil*_*Lou 5 php centos upgrade

我试图找到一种简单的方法来升级我的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
Run Code Online (Sandbox Code Playgroud)

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

Joe*_*lls 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/