Windows PHP54 Configuration MongoDB extension (with various other versions download address)

Source: Internet
Author: User
Tags mongodb server
Reference:

Http://jingyan.baidu.com/article/d5c4b52bef7268da560dc5f8.html

Http://www.jb51.net/article/51601.htm

1 Installing the MongoDB server

(1) Go to download page to download the package under Windows

Https://www.mongodb.org/downloads#production

(2) Double-click the downloaded MSI file, select the installation location, the recommended folder in the root directory of the disk, convenient after the operation, after installation should see the structure (the red line off the file, folder does not count)


(3) Create a storage location for the database files, such as d:/mongodb/data/db. You must create a storage folder for the database files before you start the MongoDB service, otherwise the command will not be created automatically and cannot start successfully.


(4) Open cmd command line (Windows key +r, enter CMD and run)

Go to the location where MongoDB is installed, where the installation is D:\mongodb\bin

Perform

Mongod.exe--dbpath d:\mongodb\data\db

This command

(5) MongoDB default connection Port 27017, open http://localhost:27017 view, found that the connection is successful, if not successful, you can see whether the port is occupied.

2 Configuring the MongoDB extension for PHP

(1) Download Php_mongo.dll

First you need to see the current PHP version and the supported extensions (note the contents of the red box)


You can see that the landlord is using the php5.4.16 version, x86 (32-bit), support TS (Thread Safe) PHP extension

At this point, go to the download DLL to find the corresponding version

Http://pecl.php.net/package/mongo/1.6.12/windows

In view of the previous version of the landlord, the selection of the red version

(2) Put the downloaded DLL file in the corresponding location

Location in {Path}/php/ext folder

Because the landlord uses the XAMPP integration environment, so put the position is in

D:\xampp\php\ext

(3) Open php.ini

The location of this file is in {path}/php/

The landlord is in D:\xampp\php

Add the following line

Extension=php_mongo.dll

(4) Restart Apache server

Re-view Phpinfo

Can see the part

3 Connect to this database with PHP's MongoDB extension test it


 
  Listdbs ());? >

can see the display

Then the above is all the MongoDB server installation and PHP's MongoDB extension installation debugging

The above describes the Windows PHP54 Configuration MongoDB extension (with a variety of other versions of the download address), including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.