【问题标题】:Unable to install php mongo extension in centos 6.5 and php 5.4centos 6.5和php 5.4无法安装php mongodb扩展
【发布时间】:2015-03-18 17:34:32
【问题描述】:

我已经在 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

请提出解决方案。

【问题讨论】:

  • 问题似乎是您有一个针对错误版本的 PHP 模块 API 编译的 mongo 模块

标签: php linux mongodb centos6.5


【解决方案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 命令会初始化正确的版本配置。

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

【讨论】:

    猜你喜欢
    • 2016-01-18
    • 2014-05-10
    • 2015-03-04
    • 2015-04-28
    • 1970-01-01
    • 2014-11-14
    • 1970-01-01
    • 2020-04-11
    • 2018-11-14
    相关资源
    最近更新 更多