Turn from: http://www.williamsang.com/archives/25.html
1. Download MONGO PHP driver
Download Address: Http://github.com/mongodb/mongo-php-driver/downloads
Github-mongo-php-driver Determine your PHP version (the phpinfo () function can list your PHP version, see Step Five) to select the appropriate version according to thread safety (non-thread safe with the NTS typeface), If the Apache server chooses thread-safe, it is not thread-safe to run in CGI. Determine your own operating system version. (64 of the words are 64-bit operating systems, no 32-bit)
Like what:
Php_mongo-1.3.0rc3-5.4-vc9-nts-x86_64.dll said:
PHP version is 5.4
Non-thread-safe (NTS)
64-bit operating system (X86_64)
Php_mongo-1.3.0rc3-5.4-vc9.dll said:
PHP version is 5.4
Thread safe (no nts words)
32-bit operating system (64 is not clearly indicated, 32 bits)
2. Extract to the "ext" subdirectory under the PHP installation directory
Also change the file name: Php_mongo.dll
Php-mongo-dll
3. Modify PHP.ini
At the end of php.ini add the following content
1 |
Extension=php_mongo.dll |
Php-ini-mongo
4. Restart Apache (or another Web server)
5. Verify that the installation was successful.
Open a PHP page (the contents below), search for MONGO, if the following figure appears, the installation is successful.
1 2 3 |
<?php phpinfo ();?>; |
Phpinfo Verification MongoDB Driver Support TIPS:
If you start Apache, the warning shown in the following illustration appears. It means that your PHP driver selection is wrong and you can try other drivers (try a little less meat haha).
Official Installation Instructions: (Http://www.mongodb.org/display/DOCS/PHP+Language+Center)
Php-startup