Thứ Bảy, 29 tháng 3, 2014

Install the MongoDB PHP Driver on Ubuntu



First, to get this thing going, we'll need to resolve some dependencies. To do that, run this command from the terminal:
$ sudo apt-get install php-pear php5-dev
Next, you should easily be able to install the driver with the following command:
$ sudo pecl install mongo
What makes Ubuntu 12.04 a little different from other systems in how PHP extensions get loading when Apache/PHP starts. To make sure this extension gets loaded, we'll need to add a .ini file to "/etc/php5/conf.d". To do that, run the following command:
$ sudo touch /etc/php5/conf.d/mongo.ini
After creating the file, add this line of content:
extension=mongo.so
After you've saved your new .ini file, restart Apache and verify that the extension is loading withphpinfo().


Source:  http://zacvineyard.com/

0 nhận xét:

Đăng nhận xét