PHP Install MongoDB Driver

Source: Internet
Author: User
Tags configuration php fpm install mongodb mongodb driver zend

Reference Link: http://docs.mongodb.org/ecosystem/drivers/php/

Method 1: Install with PECL

#pecl Install MONGO

Enter "No" in the dialog box that appears


When you are finished installing, you are prompted to write mongo.so php.ini


Method 2: Apply only to users who cannot connect to the extranet

In fact, this method is the manual version of method 1.

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

[[email protected]] #tar-ZXVF mongo-php-driver-1.5.8.tar.gz

[[Email protected]localhost]# CD mongo-php-driver-1.5.8

Find your own installed phpize (as determined by your own installation directory)

[Email protected] localhostmongo-php-driver-1.5.8]#/usr/local/php56/bin/phpize

Configuring for:

PHP apiversion:20131106

Zend Module apino:20131226

Zend Extension apino:220131226

[Email protected] mongo-php-driver-1.5.8]#

./configure--enable-mongo=share--with-php-config=/usr/local/php56/bin/php-config

[[email protected] mongo-php-driver-1.5.8] #make

Build complete.

Don ' t forget Torun ' make test '.

[[email protected] localhostmongo-php-driver-1.5.8]# make install

Installing sharedextensions:/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/

Description installation Successful Next configuration php.ini

Edit PHP.ini Join

Extension=mongo.so

Restart PHP-FPM

Pkill PHP-FPM

/usr/local/php/sbin/php-fpm

Verification: Php–m

Check if the terminal output has MONGO, if yes, prove OK

How do I uninstall this driver?

#pecl Uninstall MONGO

It's OK.

PHP Install MongoDB Driver

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.