Windows Server installation of PHP MongoDB Extensions method _win Server

Source: Internet
Author: User
Tags mongodb mongodb version php compiler php mongodb phpinfo

This article will describe the process of installing MONGODB extension in Wamp environment, you can have a little reference

Linux version can refer to the previous Linux installation php MongoDB extension

Installation Environment

System environment: Windows 7 64-bit

Apache Version: 2.4.9

PHP Version: 5.5.12

MongoDB version: 3.2.6

Wamp version: Wamp 2.5 64-bit

Installing MongoDB under Windows is a little more complex than a Linux environment.

Installation steps

First, determine the PHP compiler

By looking at phpinfo () you can determine

As you can see from the above picture, compiler is VC11

Ii. Determine if PHP is a thread-safe version

By looking at phpinfo () you can determine


If enabled, the thread safety version is indicated

Third, download the corresponding PHP-MONGODB version

Based on the information obtained above, it is necessary to download and conform to Php5.5,vc11,ts (thread safety), 64-bit extension

In general, the official website information is the latest and most complete, recommended to the official website to download. The download address is: http://windows.php.net/downloads/pecl/releases/mongo/. I chose the 1.6.10 version of the


Download Php_mongo-1.6.10-5.5-ts-vc11-x64.zip back, the inside of the php-mongo.dll copied to the PHP plug-in directory, I am the machine: D:\wamp\bin\php\php5.5.12\ext

Add the Libsasl.dll path to the system environment variable

According to http://php.net/manual/en/mongo.installation.php, installing MONGO extensions relies on Libsasl.dll, so add the directory to the system environment variable. This directory is typically the root directory of PHP. Under Wamp 2.5, if the Wamp installation disk is D, the location of the directory is probably D:\wamp\bin\php\php5.5.12

V. Join Extension=php_mongo.dll in PHP.ini

Extension=php_mongo.dll this line of words needs to be based on the actual situation, some are extension=php_mongodb.dll, depending on the D:\wamp\bin\php\php5.5.12\ext directory MONGO extension of the name.

Note: Wamp generally have two php.ini files, one is located in the root directory of PHP, one is Apache root directory, you need to add the Apache root directory under the php.ini.

Six, restart Wamp service

It's best to quit and then open it.

Finally, the picture above experiences the wonderful moments after installation.

After the installation is successful, view the Phpinfo layout, which will display the following content.

At this point, the Windows add PHP MONGO extension successfully ended.

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.