MongoDB Installation
From DreamFactory
Line 1: | Line 1: | ||
==Drivers== | ==Drivers== | ||
====Bitnami Installs on Windows, Mac, and Linux==== | ====Bitnami Installs on Windows, Mac, and Linux==== | ||
− | The Bitnami packages come with an instance of MongoDB and the drivers already installed. No further action is necessary. | + | '''Note''':The Bitnami packages come with an instance of MongoDB and the drivers already installed. No further action is necessary. |
===Linux=== | ===Linux=== | ||
− | *Ensure that you have the php-pear and php5-dev packages installed on your system. You will also need the pcre3 and sasl2 development libraries. | + | * '''Ensure that you have the php-pear and php5-dev packages installed on your system. You will also need the pcre3 and sasl2 development libraries.''' |
**<source lang=bash>$ sudo apt-get install php-pear php5-dev libpcre3-dev libsasl2-dev</source> | **<source lang=bash>$ sudo apt-get install php-pear php5-dev libpcre3-dev libsasl2-dev</source> | ||
− | *Use PECL to make the mongo.so file | + | * '''Use PECL to make the mongo.so file''' |
**<source lang=bash>$ sudo pecl install mongo</source> | **<source lang=bash>$ sudo pecl install mongo</source> | ||
− | + | '''Note''':If the the install generates any errors it will fail. You will need to troubleshoot based on the error reported. | |
− | *Create a module file for your mongo installation. | + | * '''Create a module file for your mongo installation.''' |
**<source lang=bash>$ sudo touch /etc/php5/mods-available/mongo.ini</source> | **<source lang=bash>$ sudo touch /etc/php5/mods-available/mongo.ini</source> | ||
− | *Edit the file you just created in your preferred text editor. | + | * '''Edit the file you just created in your preferred text editor.''' |
**There is a single line in the file it looks like this: | **There is a single line in the file it looks like this: | ||
**<source lang=bash>extension=mongo.so</source> | **<source lang=bash>extension=mongo.so</source> | ||
− | *Enable the php extension | + | * '''Enable the php extension''' |
**<source lang=bash>$ sudo php5enmod mongo</source> | **<source lang=bash>$ sudo php5enmod mongo</source> | ||
− | *Restart your web service service | + | * '''Restart your web service service''' |
**<source lang=bash>$ sudo service apache2 restart</source> or | **<source lang=bash>$ sudo service apache2 restart</source> or | ||
**<source lang=bash>$ sudo service nginx restart</source> | **<source lang=bash>$ sudo service nginx restart</source> |
Revision as of 16:42, 6 February 2016
Drivers
Bitnami Installs on Windows, Mac, and Linux
Note:The Bitnami packages come with an instance of MongoDB and the drivers already installed. No further action is necessary.
Linux
- Ensure that you have the php-pear and php5-dev packages installed on your system. You will also need the pcre3 and sasl2 development libraries.
$ sudo apt-get install php-pear php5-dev libpcre3-dev libsasl2-dev
- Use PECL to make the mongo.so file
$ sudo pecl install mongo
Note:If the the install generates any errors it will fail. You will need to troubleshoot based on the error reported.
- Create a module file for your mongo installation.
$ sudo touch /etc/php5/mods-available/mongo.ini
- Edit the file you just created in your preferred text editor.
- There is a single line in the file it looks like this:
extension=mongo.so
- Enable the php extension
$ sudo php5enmod mongo
- Restart your web service service
- or
$ sudo service apache2 restart
$ sudo service nginx restart