PHP Connection MongoDB
wget ' https://codeload.github.com/mongodb/mongo-php-driver/zip/master '-o/usr/local/src/mong_php.zip
cd/usr/local/src/
Unzip Mong_php.zip
CD mongo-php-driver-master/
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config
Make
Make Install
Vi/usr/local/php/etc/php.ini//increase extension = mongo.so
/usr/local/php/bin/php-m
Restart Apache, reload PHP
Test:
vi/usr/local/apache2/htdocs/1.php//Increase
<?php
//Connect to MongoDB
$m = new Mongoclient ();
echo "Connection to database successfully";
//Select a database
$db = $m->mydb;
echo "Database mydb selected";
?>
Access Curl localhost/1.php if the output
Connection to Database successfullydatabase mydb selected
The instructions are correct.
More Test AccessHttp://www.runoob.com/mongodb/mongodb-php.html
extension: MongoDB shard http://www.lanceyan.com/tech/arch/mongodb_shard1.html
PHP Connection MongoDB