Make sure apache2 and PHP5 + are installed on your server:
sudo apt-get install apache2 php5 libapache2-mod-php5
Install some dependencies for the driver:
sudo apt-get install php-pear php5-dev
And install it: sudo pecl install mongo
Now letβs hack this php.ini too located in / etc / php 5 / apache2 / path. Do this by adding the mongo.so extension somewhere after the extension part:
sudo vim /etc/php5/apache2/php.ini Add : extension = mongo.so
Then restart the apache server:
sudo service apache2 restart
Mahbub tito
source share