2014-04-24 31 views
0

我一直在使用Centmin來幫助管理我的Web服務器。我最近啓動了一個開發服務器來更新我當前的生產服務器。現在我有問題試圖讓PHP 5.4.27及其模塊工作。目前,只有兩個在php-fpm restart上拋出錯誤的模塊是memcache和memcached。在CentOS上PHP和模塊API不匹配

服務器正在運行的Nginx和PHP-FPM

Starting php-fpm [24-Apr-2014 11:31:02] NOTICE: PHP message: PHP Warning: PHP Startup: memcache: Unable to initialize module 
Module compiled with module API=20090626 
PHP compiled with module API=20100525 
These options need to match 
in Unknown on line 0 
[24-Apr-2014 11:31:02] NOTICE: PHP message: PHP Warning: PHP Startup: memcached: Unable to initialize module 
Module compiled with module API=20090626 
PHP compiled with module API=20100525 
These options need to match 

我已經試過PECL升級,卸載和安裝模塊。我也試着用yum來安裝它們。我能做些什麼來解決這個問題?

回答

1

您收到的錯誤是因爲您嘗試安裝/升級的模塊是使用不同版本的PHP構建的。

要麼安裝與使用OR構建模塊的PHP版本相同的版本,只需手動編譯模塊,這很容易實現。

1) Download pecl module and untar 
2) cd into module directory and phpize 
3) ./configure 
4) make && make install 

確保模塊安裝到正確的擴展目錄中,以便php.ini可以加載它們。某些pecl模塊也有特定的./configure選項,您可以在編譯之前通過運行./configure --help來檢查這些模塊。