Установка
To get the source:
$ cvs -d :pserver:cvsread@cvs.php.net:/repository checkout pecl/mongo
# password: phpfi
To build, use:
$ cd pecl/mongo
$ ./configure --enable-mongo
$ make
Options used by configure
Option |
Default |
Description |
--with-mongodb=/path/to/mongodb |
/usr/local |
Path to local mongodb install |
--with-boost=/path/to/boost/libs |
/usr/lib/ |
Path to boost libraries |
--enable-64 |
no |
Compile for 64-bit architecture |
Note for Mac OS X users: Web Sharing uses 64-bit PHP, however, the command line PHP uses 32-bit.
Therefore, you have to use --enable-64 to force command-line PHP to build an Apache-compliant
PHP extension.
To install:
$ sudo cp modules/mongo.so /path/to/extension_dir
$ sudo cp src/php/* /path/to/php/includes/mongo/
php.ini settings:
To load this extension on startup, add a line:
extension=mongo.so
You should also add some default settings:
[mongo]
; Default host for mongo connection
mongo.default_host = localhost
; Default port for mongo database
mongo.default_port = 27017
; If the driver should reconnect to mongo
mongo.auto_reconnect = true