How to Set PHP Connects to Mongodb

1. First download a php extension driver for mongodb that matches the current php version number

The download link is as follows: http://pecl.php.net/package/mongodb

2. Find the path of the current PHP link database: D: \ phpstudy \ PHPTutorial \ php \ php-5.6.27-nts \ ext, extract the compressed package you just downloaded, and put the php_mongodb.dll driver file inside.

3. Find the PHP configuration file D: \ phpstudy \ PHPTutorial \ php \ php-5.6.27-nts \ php.ini, open and find the following content, add extension = php_mongodb.dll at the bottom

4. Restart apache, enter phpinfo () in the php document; output the current version information, view the version, and add the mongodb database information

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: