After finishing this part, your php will be able to use mongodb function.
To install mongodb php driver, first of all we need pecl to install from PHP repository.
#sudo apt-get install php5-dev php5-cli php-pear
Running pecl to get and install php driver.
#sudo pecl install mongo
Turn your back to the screen and have a coffee while system compiling the mongo extension. After finishing installation, you will see this :
Build process completed successfully
Installing '/usr/lib/php5/20090626+lfs/mongo.so'
install ok: channel://pecl.php.net/mongo-1.2.6
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
Then, edit php.ini (/etc/php5/cli/php.ini, ubuntu) and add this line extension=mongo.so.
Reference : http://www.mongodb.org/display/DOCS/PHP+Language+Center
ไม่มีความคิดเห็น:
แสดงความคิดเห็น