???????????????????????? Mongodb PHP Extension
MongoDB Installation
1: Download MongoDB www.mongodb.org Download the latest version of stable
2: Unzip the file
3: Do not compile, itself is the compiled binary executable file.
4: Start the Mongod service
./bin/mongod--dbpath/path/to/database--logpath/path/to/log--fork--port 27017
Parameter explanation:
--dbpath Data Storage Directory
--logpath Log Store Directory
--port Run port (default 27017)
--fork Background Process Run
./bin/mongod–dbpath/home/mdb–logpath/home/mlog/m1.log–fork–port 27017–smallfiles
./bin/mongo
To connect to a server:
?
MongoDB's PHP extension s
- Pecl.php.net
2. Download Php-mongodb extension
3, mongodb-1.1.6:
Http://pecl.php.net/get/mongo-1.6.13.tgz
?
4. Compiling and Installing:
$ tar zxvf mongodb-mongodb-php-driver-<commit_id>.tar.gz
$ CD mongodb-mongodb-php-driver-<commit_id>
[Email protected] mongo-1.6.13]#/usr/local/php5.6/bin/phpize
[Email protected] mongo-1.6.13]#/configure--with-php-config=/usr/local/php5.6/bin/php-config
[[email protected] mongo-1.6.13]# make && make install
After successful compilation:
/usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/
5 , find php.ini File: Find/-name php.ini
Vim/etc/php.ini
Add one line:extension=/usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/ mongo.so
after executing the above command, you need to modify php.ini files, in php.ini files are added MONGO configuration, configured as follows:
Note: you need to indicate The path to the Extension_dir configuration item.
?
6. Finally check if Phpinfo () is installed successfully:
Mongodb PHP extensions and installation