1To use mongodb with php you have to use mongodb php driver. Kindly follow below to download the latest mongodb php driver.
2https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
3After downloading unzip the file put php_mongo.dll into php extesion directory.
4And add below line into your php.ini file
5extension = php_mongo.dll
6
7To test its working or not execute below line of code on browser
8<?php
9 // connect to mongodb
10 $m = new MongoClient();
11
12 echo "Connection to database successfully";
13 // select a database
14 $db = $m->mydb;
15
16 echo "Database mydb selected";
17?>