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