Mongodb Application Practice Tutorial: PHP Driver Installation

Source: Internet
Author: User
Tags mongodb driver
Should LAMP be deeply rooted in the hearts of the people? Since nginx became popular, LNMP began to replace LAMP or derive LANMP. I keep thinking, can I change M to another concept? Mysql is undoubtedly an excellent enterprise-level open source relational database. However, in this big data era, the bottlenecks of relational databases in WEB applications have become increasingly obvious. In some scenarios

Should LAMP be deeply rooted in the hearts of the people? Since nginx became popular, LNMP began to replace LAMP or derive LANMP. I keep thinking, can I change M to another concept? Mysql is undoubtedly an excellent enterprise-level open source relational database. However, in this big data era, the bottlenecks of relational databases in WEB applications have become increasingly obvious. In some scenarios

Should LAMP be deeply rooted in the hearts of the people? Since nginx became popular, LNMP began to replace LAMP or derive LANMP. I keep thinking, can I change M to another concept? Mysql is undoubtedly an excellent enterprise-level open source relational database. However, in this big data era, the bottlenecks of relational databases in WEB applications have become increasingly obvious. In some cases, replacing relational databases with Nosql has gradually become a trend. The emergence of Mongodb has intensified this trend. To some extent, Mongodb retains the data structure, retains some excellent features of relational databases, and discards some inefficient functions. Therefore, replacing mysql with Mongodb is feasible in many cases.

Replacing mysql with mongo requires connection with php. Php has built-in support for mysql, but the mongodb driver is not included in the official php package by default. Install it on your own.

First, you can download the php driver from the official mongodb website. Mongodb maintains a php driver project on github. The address is https://github.com/mongodb/developer-php-driver/downloads. You can download it as needed.

Download and decompress the package. Select the appropriate dll and change it to php_cmd.dll. Copy to the ext folder in your php Directory. My directory is D: \ WebServer \ php \ ext. Then modify your php. ini file. Add the following statement anywhere in the file.

;MongoDBextension=php_mongo.dll

Save php. ini and restart apache, iis, or php-fpm.

Use phpinfo (); to view your php environment.

It indicates that the installation is successful. Try the efficiency of mongo in php!

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.