PHP MongoDB Extension Other extensions are similar

Source: Internet
Author: User
Tags install mongodb php mongodb

MongodbPHP Extensions

This tutorial will show you how to install MongoDB extensions on Linux, Windows, MAC platforms.

Installing MongoDB PHP extensions on Linux on the terminal

You can install MongoDB's PHP extension driver by executing the following command in Linux

$ sudo pecl install MONGO

The PECL installation command using PHP must ensure that the network connection is available and rooted.

Installation Manuals

If you want to compile the extension driver through the source code. You have to manually compile the source package, so it's good that the latest bug fixes are included in the source package.

You can download the MongoDB PHP driver package on GitHub. Visit the GitHub website and search for "MONGO PHP Driver" (: https://github.com/mongodb/mongo-php-driver), download the source package, and then execute the following command:

$ tar zxvf mongodb-mongodb-php-driver-<commit_id>.tar.gz
$ CD mongodb-mongodb-php-driver-<commit_id>
$ phpize
$./configure
$ sudo make install

If your PHP is compiled yourself, the installation method is as follows (assuming it is compiled in the/usr/local/php directory):

$ tar zxvf mongodb-mongodb-php-driver-<commit_id>.tar.gz
$ CD mongodb-mongodb-php-driver-<commit_id>
$/usr/local/php/bin/phpize
$./configure--with-php-config=/usr/local/php/bin/php-config
$ sudo make install

After executing the above command, you need to modify the php.ini file, add the MONGO configuration in the php.ini file, and configure the following:

Extension=mongo.so

PHP MongoDB Extension Other extensions are similar

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.