Skip to content

Instantly share code, notes, and snippets.

@rkalkani
Last active September 5, 2017 05:26
Show Gist options
  • Save rkalkani/f841fd9335c7df024ea7f907c2ad7abc to your computer and use it in GitHub Desktop.
Save rkalkani/f841fd9335c7df024ea7f907c2ad7abc to your computer and use it in GitHub Desktop.
Install php mongodb driver for mongodb 3.4
# Ubuntu 16.04
sudo apt-get install libcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev
# Install php dev
sudo apt-get install php-dev
# for php5.6, sudo apt-get install php5.6-dev
# Install pecl
sudo apt-get install php-pear
sudo pecl install mongodb
# add extension=mongodb.so in fpm and cli:
sudo vim /etc/php/7.0/fpm/conf.d/30-mongodb.ini
# for php5.6, sudo vim /etc/php/5.6/fpm/conf.d/30-mongodb.ini
sudo vim /etc/php/7.0/cli/conf.d/30-mongodb.ini
# for php5.6, sudo vim /etc/php/5.6/cli/conf.d/30-mongodb.ini
sudo vim /etc/php/7.0/apache2/conf.d/30-mongodb.ini
# for php5.6, sudo vim /etc/php/5.6/apache2/conf.d/30-mongodb.ini
# Restart service:
sudo systemctl restart php7.0-fpm
sudo systemctl reload nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment