Skip to content

Instantly share code, notes, and snippets.

@imposibrus
Last active January 6, 2018 12:13
Show Gist options
  • Save imposibrus/d21cddf71a33395b8aa5 to your computer and use it in GitHub Desktop.
Save imposibrus/d21cddf71a33395b8aa5 to your computer and use it in GitHub Desktop.
Install MongoDB PHP driver on Ubuntu 14.04
sudo apt-get install -y php-pear php5-dev
sudo pecl install mongo
sudo sh -c "echo 'extension=mongo.so' > /etc/php5/mods-available/mongo.ini"
sudo ln -s /etc/php5/mods-available/mongo.ini /etc/php5/apache2/conf.d/mongo.ini
sudo service apache2 restart
@prasad83
Copy link

prasad83 commented Jan 6, 2018

It is good to enable mongo extension for PHP CLI mode as done for Apache.

sudo sh -c "echo 'extension=mongo.so' > /etc/php5/cli/mongo.ini"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment