Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uninstall mongodb php driver and install a different version

I'm using Ubuntu Xampp (Lampp) and currently on MongoDB 1.5.3 driver.

I need to downgrade to 1.4.5, but when re-installed the downgraded driver, it does not change in phpinfo(). Yes, I have restarted Apache.

So, how do I uninstall the current one and install the downgraded version?

like image 212
AFwcxx Avatar asked Jun 09 '14 08:06

AFwcxx


People also ask

What is Mongodb PHP driver?

MongoDB driver ¶It provides a minimal API for core driver functionality: commands, queries, writes, connection management, and BSON serialization. Userland PHP libraries that depend on this extension may provide higher level APIs, such as query builders, individual command helper methods, and GridFS.


1 Answers

Update: 2018-06-20:

PECL package mongo is now deprecated, you should use mongodb package instead:

sudo pecl install -f mongodb-1.4.4

Original answer

You can upgrade to a specific version of a driver by using pecl:

sudo pecl install -f mongo-1.4.5

If you get a pecl: command not found error you will need to install PEAR package:

sudo apt-get update && sudo apt-get install php-pear

You can use this command to check that you have the correct version installed:

sudo pecl info mongo

Or you can check php configuration directly with:

php -i | grep -A 1 MongoDB
like image 59
Christian P Avatar answered Oct 12 '22 10:10

Christian P