PHP无法加载动态库(mongo.so) [英] PHP unable to load dynamic library (mongo.so)
问题描述
我正在尝试使用Rockmongo.安装后,我无法使用它.它说:"要正确处理,必须安装php_mongo模块.此处是PHP.net上的安装文档."
i'm trying to use rockmongo. After installation, i'm unable to use it. It says "To make things right, you must install php_mongo module. Here for installation documents on PHP.net."
我已经通过sudo pecl install mongo
安装了mongoDB驱动程序扩展.
i have already installed mongoDB driver extension via sudo pecl install mongo
.
locate mongo
显示/usr/lib/php5/20090626+lfs/mongo.so
但是,php -v
显示的警告很少(我认为与mongo有关)
However, php -v
shows few warnings (which i think is related to mongo)
PHP: syntax error, unexpected $end, expecting ']' in /etc/php5/cli/conf.d/mongodb.ini on line 3
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/mongo.so' - /usr/lib/php5/20100525+lfs/mongo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.4.28-1+deb.sury.org~precise+1 (cli) (built: May 5 2014 09:39:26)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
我打开了/usr/lib/php5/
,发现还有另一个目录( 20090626 + lfs ),其中包含mongo.so.
i opened /usr/lib/php5/
and found out that there are another directory(20090626+lfs) which contains mongo.so.
我尝试了各种在线教程,但没有任何帮助.
i tried various online tutorial, but nothing helped.
编辑:这是我的mongodb.ini
Edit: Here's my mongodb.ini
;----- start -----
extension=mongo.so
\[mongo\]
; If the driver should reconnect to mongo
mongo.auto_reconnect = true
; Whether to allow persistent connections
mongo.allow_persistent = On
; Maximum number of persistent connections (-1 means unlimited)
mongo.max_persistent = -1
; Maximum number of links (persistent and non-persistent, -1 means unlimited)
mongo.max_connections = -1
; Default host for mongo connection
mongo.default_host = www.example.com
; Default port for mongo database
mongo.default_port = 42
; When saving files to the database, size of chunks to split them into
mongo.chunk_size = 1024
; Specify an alternate character to $ to use for special db functions ($set, $push, $exists, etc.)
mongo.cmd = "$"
;----- end -----
推荐答案
我使用适用于 php 5 的mongodb驱动程序1.1.9版本解决了此问题.首先卸载当前版本的mongodb,然后安装1.1.9版本:
I solved this problem using the 1.1.9 version of mongodb driver for php 5. First uninstall the current version of mongodb and then install the 1.1.9 version:
sudo pecl uninstall mongodb
sudo pecl install mongodb-1.1.9
composer update
这篇关于PHP无法加载动态库(mongo.so)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!