安装mongophp驱动程序centos6.6


Install mongo php driver centos 6.6

我的托管提供商安装了一个带有Centos 6.6+Direct Admin+PHP 5.6.6的云托管VPS。

我需要安装MongoDB php驱动程序才能连接到外部MongoDB。

我尝试了以下安装:

  • http://www.liquidweb.com/kb/how-to-install-the-mongodb-php-driver-extension-on-centos-6/
  • http://andres.jaimes.net/876/setup-mongo-php-module-centos-6/
  • 在madcoda.com上安装-mongodb-hp-driver-in-centos-6-3

同样,yum --enablerepo=remi,remi-php56 php-pecl-mongo不起的作用

我在/usr/lib64/php/modules/中有以下模块:bz2.socalendar.soctype.socurl.soexif.sofileinfo.softp.sogettext.soiconv.sojson.somongo.sophar.sosockets.sotokenizer.sozip.so

/etx/php.d/中,为每个模块创建的.ini文件。

在带有centos5.x的旧vps上安装mongophp驱动程序不是问题,在带有php5.5的Centos6.2上也不是问题。在这些情况下,mongo.so位于/usr/local/php/lib/php/extensions/no-debug-non-zts-xxxxxx/位置,必须手动将其添加到php.ini 中

除了我得到的默认安装之外,主机提供商不支持任何其他安装。

我真的很感激任何帮助。

Stan

我在这个答案的注释中找到了解决方案https://serverfault.com/questions/589877/pecl-command-produces-long-list-of-errors由于服务器上运行的是PHP 5.6,因此必须从remi-hp56 repo重新安装PEAR。之后,我可以使用pecl install mongo并将mongo.so复制到/usr/local/php/lib/php/extensions/no-debug-non-zts-xxxxxx/文件夹中。

# php -m | grep -i mongo>mongo正在运行