Follow the below simple steps to configure Mongodb with PHP.
- Click on this link to download the drivers.
http://pecl.php.net/package/mongo/1.6.14/windows
From above link, download the appropriate. I have downloaded 5.4 Thread Safe (TS) x86 - Unizip this folder.
- Copy the php_mongo.dll file from unzipped file and paste in extension directory of php. (In My Case: E:\wamp\bin\php\php5.4.3\ext)
- Open php.ini file, (In My Case E:\wamp\bin\apache\apache2.2.22\bin\php.ini)
- Add following line in php.ini file.
extension=php_mongo.dll
- Re-Start the wamp Server.
- Check drivers installed with phpinfo()., See following in my case.
Question: How to connect MongoDb Drivers with PHP?
$m = new MongoClient();