After installation of Mongo 2.6.0
which was successful, I tried to upgrade php mongo
driver on ubuntu 12.04
with the following command: sudo pecl upgrade mongo
. It started successfully with:
downloading mongo-1.5.1.tgz ...
Starting to download mongo-1.5.1.tgz (188,885 bytes)
.........................................done: 188,885 bytes
117 source files, building
running: phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
Build with Cyrus SASL (MongoDB Enterprise Authentication) support? [no]:
Where I selected No
because when I tried yes, it was failing with error. With no I was able to install it successufully and the ending message looked like this:
Build process completed successfully
Installing '/usr/lib/php5/20121212/mongo.so'
install ok: channel://pecl.php.net/mongo-1.5.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
After this I restarted apache (2.4.9
), but my phpinfo()
told me that mongo is not installed. On the other hand I can clearly see extension=mongo.so
in my php.ini.
I checked my error.log and I can see the following line there:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php5/20121212/mongo.so' - /usr/lib/php5/20121212/mongo.so:
undefined symbol: php_json_encode in Unknown on line 0
I checked my /usr/lib/php5/20121212/
and saw that there is actually a file mongo.so
. I googled it and the only similar thing I was able to find is this, which is not really relevant, but having no other options I still tried steps there with no success.
Does anyone has an idea how to fix this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…