Find it more and more lazy recently ... One months an article--!
Environment: Windows 7, IIS7, php5.3.5, MongoDB 2.6
The overall steps are:
Install
MongoDB, install the MongoDB extension of PHP, and install MongoDB as a service.
Http://www.mongodb.org/downloads
PHP's MongoDB extended download:
Https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
The above extensions basically only provide a download of the PHP VC9 VC11 version, if your PHP is VC6 you can find MONGO install –>installing on Windows by searching MONGO in the PHP manual. In which there is a for VC6 download.
To see the VC a few please check phpinfo ().
The compiled version of 1.php is VC6
2.32-bit
3. Thread Safety
Download the decompression package and add the ' php_mongo.dll ' file to your PHP Extended directory (EXT).
Open the PHP configuration file php.ini add MONGO extension:
Print phpinfo (), and if there is no problem, the MongoDB information will be found in the Phpinfo, as in the following image:
PS: Run the MongoDB installer is installed by default to the C disk, you can/bin all files in the installation directory to move to where you want, such as I put it back to the D:serversmongodb.
Start the installation of Windows system services so that MongoDB can start the service automatically as the system starts.
Right-click to run cmd as an administrator.
CD switch to your MONGO directory and execute the following command:
Mongod--install--servicename "MongoDB"--servicedisplayname "MongoDB" "--dbpath" D:serversmongodbdata "--logpath" D: Serversmongodbmongodb.log "
The set values within quotation marks can be modified by themselves.
Uninstall Service:
Uninstall Service:
Mongod.exe--remove--servicename "MongoDB"
Test:
<?php
$mongo = new MongoDB ();
Var_dump ($mongo->connected); True
?>