0

我在 Centos 6.5 中安装了 PHP 5.4 和 mongodb。

我尝试使用http://www.liquidweb.com/kb/how-to-install-the-mongodb-php-driver-extension-on-centos-6/中给出的说明安装 PHP mongodb 扩展,但是当我运行php -m | grep -i mongo,它显示以下错误:

PHP Warning:  PHP Startup: mongo: 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

请提出解决方案。

4

1 回答 1

1

我会手动安装它。这与 pecl/pear 所做的完全相同:

wget http://pecl.php.net/get/mongo-1.6.5.tgz
tar xzf mongo-1.6.5.tgz
cd mongo-1*
phpize
./configure --enable-mongo --with-php-config=php-config --prefix=/usr/lib/php5/
make && make install

phpize正确的版本配置由命令初始化。

确保您的库路径是/usr/lib/php5,如果不是,请在./configure参数中更改它。

于 2015-03-18T09:34:32.543 回答