Installing the PHP 7 Mongodb Client/Driver

How to install the MongoDB driver for PHP 7 on Windows 7?

MongoDB offers its own driver, with installation instructions on how to set it up, after which you'll have to use the the MongoDB Driver API, rather than the now obsolete MongoClient way of connecting. If phpinfo() shows the mongodb extension working, then you should be able to connect to it using the updated syntax:

$client = new MongoDB\Driver\Manager("mongodb://localhost:....");

Install MongoDB driver in Cent os 7 with php7.1

You can Install mongodb manually with following commands:
First install php71w-devel package with following command:

sudo yum install php71w-devel -y

and then you can install it manually.

$ git clone https://github.com/mongodb/mongo-php-driver.git
$ cd mongo-php-driver
$ git submodule sync && git submodule update --init
$ phpize
$ ./configure
$ make all -j 5
$ sudo make install

ref:http://php.net/manual/en/mongodb.installation.manual.php



Related Topics



Leave a reply



Submit