Installing mongoDB driver php 7.2.3

Ttech picture Ttech · Apr 1, 2018 · Viewed 17.1k times · Source

I am trying to install the mongoDB driver for PHP 7.2.3 x86. I installed the PHP 7.2 Non Thread Safe driver here: https://pecl.php.net/package/mongodb/1.4.2/windows

I have put the mongodb.dll file in the php/ext and put ;extension=mongodb in the php.init file under "Dynamic Extensions".

When I go to my phpinfo() mongo doesn't show up. Running the composer require jenssegers/mongodb command just says: "Unable to load dynamic library 'mongodb'..."

How do I fix this? (I am using xampp)

Answer

Muzafar Ali picture Muzafar Ali · Jul 13, 2018

You an install mongoDB driver for PHP v7.2.x to run these commands on ubuntu 16.04

 sudo apt install php7.2-mongodb

Or

sudo apt-get install php7.2-mongodb

if you need to install MongoDB you can follow this https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/