I added the mongo.so extension to /etc/php5/apache2/php.ini and it is loading perfectly in php info.

But it does not work with /etc/php5/cli/php.ini.

When I try to run composer for adding mongodb lib it gives this error:

mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.

Do anyone know what is the problem?

1 Answer 1


mongo.so is the legacy driver but you need the new one https://pecl.php.net/package/mongodb and it should be installed like described here http://mongodb.github.io/mongo-php-driver/#installation

You need at least these packages for building php5 php-pear php5-dev openssl pkg-config libpcre3-dev

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .