Linux: Ubuntu下PECL安裝MongoDB的PHP擴展

The MongoDB PECL extension has not been installed or enabledphp

If you have installed MongoDB and you get the above error or something similar to it, you will need to install the php extension. It’s quite easy, shouldn’t take more than a couple of minutes. All the commands were executed as root, if you want to use the sudo mechanism, just prefix all the commands with sudo.web

Install the required packagesapache

apt-get install php-pear php5-dev make

If everything went ok, simply install the extension by executing this command:ui

pecl install mongo

Activate the MongoDB extensionthis

I have Ubuntu 12.04 server edition installed on the server so I simply added a new ini file containing one line:rest

echo "extension=mongo.so" > /etc/php5/apache2/conf.d/mongo.ini

Now restart web server (in my case Apache 2.2) and enjoy:code

service apache2 restart
相關文章
相關標籤/搜索