dongyin5516 2015-03-03 17:06
浏览 52
已采纳

安装mongo php驱动程序centos 6.6

I have a cloud hosted VPS with Centos 6.6 + Direct Admin + PHP 5.6.6 installed by my hosting provider.

I need to have the MongoDB php driver installed to connect to an external mongoDB.

I tried the following installations:

Also yum --enablerepo=remi,remi-php56 php-pecl-mongo does not do the trick

I have in /usr/lib64/php/modules/ the following modules: bz2.so, calendar.so, ctype.so, curl.so, exif.so, fileinfo.so, ftp.so, gettext.so, iconv.so, json.so, mongo.so, phar.so, sockets.so, tokenizer.so, zip.so

And in /etx/php.d/ the .ini files that are created for each module.

Installing mongo php driver on an old vps with centos 5.x was not a problem also not on Centos 6.2 with php 5.5. In these cases the mongo.so was located in the location /usr/local/php/lib/php/extensions/no-debug-non-zts-xxxxxx/ and had to add it manually to the php.ini

The hosting provider is not supporting any else than the default installation I got.

I really appreciate any help.

Stan

  • 写回答

1条回答 默认 最新

  • douwei9973 2015-03-03 19:44
    关注

    I found the solution in the comment of this answer https://serverfault.com/questions/589877/pecl-command-produces-long-list-of-errors PEAR had to be reinstalled from the remi-php56 repo because of PHP 5.6 running on the server. After that I could use pecl install mongo and copy the mongo.so to the /usr/local/php/lib/php/extensions/no-debug-non-zts-xxxxxx/ folder.

    # php -m | grep -i mongo > mongo is running

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 socket通信实现多人聊天室疑惑
  • ¥15 DEV-C++编译缺失
  • ¥33 找熟练码农写段Pyhthon程序
  • ¥100 怎么让数据库字段自动更新
  • ¥15 antv g6 力导向图布局
  • ¥15 quartz框架,No record found for selection of Trigger with key
  • ¥15 锅炉建模+优化算法,遗传算法优化锅炉燃烧模型,ls-svm会搞,后面的智能算法不会
  • ¥20 MATLAB多目标优化问题求解
  • ¥15 windows2003服务器按你VPN教程设置后,本地win10如何连接?
  • ¥15 求一阶微分方程的幂级数