Windows 7 System installation configuration Php+mongodb steps

Source: Internet
Author: User
Tags configuration php install mongodb mongodb mongodb download phpinfo
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.
MongoDB Download:
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:
Extension=php_mongo.dll
Reboot the server.
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
?>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.