2010-02-05 32 views
5

我試圖在我的CentOS5機器上使用yum找到一種簡單的方法來升級PHP,而不是自己下載源代碼並重新編譯它(我上次做了它,但它確實很難以獲得與CentOS默認相同的所有編譯配置)。無論如何,我終於使用下列的方法: http://www.atomicorp.com/wiki/index.php/PHP在CentOS上使用yum升級PHP到5.2.12

現在,命令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 

我認爲這基本上意味着我需要重新編譯這四個模塊,我怎麼能這樣做?任何建議表示讚賞。

回答

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/

+1

我同意你的意見。然而,我必須堅持CentOS(這是製作服務器環境,開發者最好是相同的)。其實,我發現我可以使用'yum升級php-mssql php-mcrypt'去除警告,但對於其他兩個,我沒有哪兩個模塊可以調用。 – WilliamLou 2010-02-05 23:03:46

+0

好的。我弄明白了,運行:pecl upgrade fileinfo,memcache – WilliamLou 2010-02-06 00:16:36

0

你應該抓the SRPM,替換壓縮包,並重建它。如果你需要任何東西,你也可以抓住the "extras" SRPM

0

嘗試

PECL安裝的FileInfo readline的內存緩存

而這應該解決這個問題。

0

pecl install memcache

爲我工作運行的Centos 5.5

1

這真的很容易,你需要添加更多的最新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和其他擴展。有用!!

相關問題