PHP Install MongoDB extension-windows version Wamp

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

This article will describe the process of installing MONGODB extension in Wamp environment, you can refer to

The Linux version can be referenced prior to the release of the PHP installation 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 complicated than the Linux environment

Installation steps

First, determine the PHP compiler

By looking at phpinfo (), you can determine

As you can see, compiler is VC11.

Second, determine if PHP is a thread-safe version

By looking at phpinfo (), you can determine

If enabled, this is the thread safety version

Third, download the corresponding PHP-MONGODB version

Depending on the information obtained earlier, you need to download an extension that complies with PHP5.5,VC11,TS (thread safety), 64-bit

In general, the official website is the latest and most comprehensive, recommended to the official website to download. Yes: 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 copy to the PHP plug-in directory, my machine is: D: \wamp\bin\php\php5.5.12\ext

Iv. adding the Libsasl.dll path to the system environment variables

According to http://php.net/manual/en/mongo.installation.php, installing the MONGO extension requires a dependency 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. Adding Extension=php_mongo.dll to the php.ini

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

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

Six, restart Wamp service

It's best to exit completely before you open it.

Finally, experience the wonderful moments after installation.

After the installation is successful, view the Phpinfo layout and the following content will be displayed.

At this point, the Add php MONGO extension under Windows successfully finishes.

PHP Install MongoDB extension-windows version Wamp

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.