Windows PHP7 Installing MongoDB extensions

Source: Internet
Author: User
Tags phpinfo

Windows PHP7 Installing MongoDB extensions
    1. Determine your own version (my version is php-7.1.9-win32-vc14-x64) If you do not know can open phpinfo view nts (non-threaded) TS (thread)
    • Note: 86 equals 32 bits
    1. Download the corresponding version of the Php_mongodb.dll file download link: https://pecl.php.net/package/mongodb/1.2.9/windows (According to my PHP version I chose php7.1 that column thread safety type) (download needs FQ, if not FQ please leave a message or add qq:1534147975)
    2. Extract the files and copy the Php_mongodb.dll files to the Ext directory under the PHP installation directory.
    3. Open PHP.ini profile Add line: Extension=php_mongodb.dll (The following files will be found in the PHP root directory: php.ini-production, which can be renamed to php.ini)
    4. Restart, and then open phpinfo () to see if there is a mongodb extension. Or, use PHP7 syntax to connect to the database when building PHP files:
<?php$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");//连接默认主机和端口为:mongodb://localhost:27017?>

The installation succeeds if no error occurs.

Windows PHP7 Installing MongoDB extensions

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.