PHP和模块API在CentOS上不匹配


PHP and Modules API Mismatch on CentOS

我已经使用Centman来帮助管理我的web服务器一段时间了。我最近刚刚启动了一个开发服务器来更新我当前的生产服务器。现在,我在尝试让php5.4.27及其模块正常工作时遇到了问题。目前,只有两个模块在php-fpm重新启动时抛出错误,分别是memcache和memcached。

服务器正在运行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升级、卸载和安装模块。我也试过用百胜来安装它们。我能做些什么来解决这个问题?

您收到的错误是因为您试图安装/升级的模块是使用不同版本的PHP构建的。

要么安装与模块构建相同版本的PHP,要么简单地手动编译模块,这很容易做到

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

确保模块也安装到正确的扩展目录中,以便php.ini可以加载它们。一些pecl模块有特定的/配置选项,您可以在编译前通过运行./configure --help来检查这些选项。