compile & enabled php5 mongodb driver (ubuntu server)

check php driver mongo db

$ php --re mongo

install php-dev – to get phpize

 $ sudo apt-get install php5-dev

get source driver from https://github.com/mongodb/mongo-php-driver

compile from source

$ tar zxvf mongodb-mongodb-php-driver-<commit_id>.tar.gz
$ cd mongodb-mongodb-php-driver-<commit_id>
$ phpize
$ ./configure
$ make all
$ sudo make install
....
Installing shared extensions:     /usr/lib/php5/20090626/

add to load ini php.ini

$ sudo nano /etc/php5/apache2/conf.d/mongo.so

input this line

; configuration for mongodb
extension=mongo.so

restart apache

$ sudo service apache2 restart

check at php_info()

Published by

G3n1k

just to remember what i had known :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s