Install the MongoDB driver for PHP in Windows

Source: Internet
Author: User
Tags mongodb driver
Www.william amsang.comarchives25.html 1. download the PHP driver for mongo: github. commongodbmongo-php-driverdownloadsgithub-mongo-php-driver determine if your PHP version (phpinfo () function can list your php version. See Step 5 for thread-safe selection.

Http://www.williamsang.com/archives/25.html 1. download mongo's PHP driver: http://github.com/mongodb/mongo-php-driver/downloads github-mongo-php-driver determine your PHP version (phpinfo () function can list your php version, see step 5) depending on whether thread security is selected

Http://www.williamsang.com/archives/25.html

1. Download the PHP driver of mongo.

: Http://github.com/mongodb/mongo-php-driver/downloads

Github-mongo-php-driver

  1. Determine Your PHP version (phpinfo () function can list your php version, see step 5)
  2. Select the corresponding version based on whether the thread is secure (not thread safe). If the apache server chooses thread security, running in CGI Mode is non-thread-safe ).
  3. Determine your operating system version. (64-bit OS, 32-bit OS)

For example:
Php_mongo-1.3.0RC3-5.4-vc9-nts-x86_64.dll representation:
The PHP version is 5.4.
Non-thread-safe (NT)
64-bit operating system (x86_64)
Php_mongo-1.3.0RC3-5.4-vc9.dll representation:
The PHP version is 5.4.
Thread-safe (without the word "NT)
32-bit operating system (32-bit without explicit representation)

2. decompress the package to the "ext" subdirectory under the PHP installation directory.

At the same time, change the file name to php_cmd.dll.

Php-mongo-dll

3. Modify php. ini

Add the following content at the end of php. ini:

1

extension=php_mongo.dll

Php-ini-mongo

4. Restart apache (or other web servers). 5. Verify that the installation is successful.

Open a PHP webpage (which contains the following content) and search for mongo. If it appears, the installation is successful.

1

2

3

phpinfo();

?>;

Phpinfo verifies MongoDB Driver Support

TIPS:

If you start apache, the Warning is displayed. It indicates that your PHP driver is incorrect. You can try other drivers ).
Official installation instructions (http://www.mongodb.org/display/DOCS/PHP+Language+Center)

Php-startup

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.