MongoDB

From DreamFactory
Jump to: navigation, search
(Created page with "This module should already be installed with your Bitnami package.")
 
 
Line 1: Line 1:
This module should already be installed with your Bitnami package.
+
If you have a Bitnami for Linux VM or Cloud image that has the older mongo driver or a too old version of mongodb driver, and need to upgrade to the mongodb driver, follow this procedure
 +
*'''Clone the source'''
 +
**You can do this from anywhere that you have write access, but we recommend your user's home folder.
 +
**<source lang=bash>git clone https://github.com/mongodb/mongo-php-driver.git</source>
 +
*'''Change into cloned repo and get submodules'''
 +
**<source lang=bash>cd mongo-php-driver</source>
 +
**<source lang=bash>git submodule sync && git submodule update --init</source>
 +
*'''Prepare the build environment for a PHP extension'''
 +
**<source lang=bash>phpize</source>
 +
*'''Install the necessary libraries'''
 +
**<source lang=bash>sudo apt-get update && sudo apt-get install libssl-dev libsslcommon2-dev libcurl4-openssl-dev pkg-config</source>
 +
*'''Configure the environment'''
 +
**<source lang=bash>./configure --with-libdir=/lib/x86_64-linux-gnu</source>
 +
*'''Compile the module'''
 +
**<source lang=bash>make all -j 5</source>
 +
*'''Install the module'''
 +
**<source lang=bash>sudo make install</source>
 +
**You should get output indicating that the module was installed to an extensions directory, for example /opt/binamit/php/lib/php/extensions/
 +
*'''Edit php.ini'''
 +
**Use your text editor of choice to edit /opt/bitnami/php/etc/php.ini .  I like vim
 +
**<source lang=bash>sudo vim /opt/bitnami/php/etc/php.ini</source>
 +
**Add a line indicating the new module. It can go anywhere in the file. I put mine right next to the mongo.so instruction.
 +
***<source lang=bash>extension=mongodb.so</source>
 +
**Save the file and exit
 +
*'''Restart the Bitnami stack'''
 +
*'''Verify successful installation using php -m and grep'''
 +
Example:
 +
<source lang=bash>[email protected]:~/mongo-php-drivers$ php -m | grep mongo
 +
mongo
 +
mongodb</source>

Latest revision as of 18:49, 28 February 2018

If you have a Bitnami for Linux VM or Cloud image that has the older mongo driver or a too old version of mongodb driver, and need to upgrade to the mongodb driver, follow this procedure

  • Clone the source
    • You can do this from anywhere that you have write access, but we recommend your user's home folder.
    • git clone https://github.com/mongodb/mongo-php-driver.git
  • Change into cloned repo and get submodules
    • cd mongo-php-driver
    • git submodule sync && git submodule update --init
  • Prepare the build environment for a PHP extension
    • phpize
  • Install the necessary libraries
    • sudo apt-get update && sudo apt-get install libssl-dev libsslcommon2-dev libcurl4-openssl-dev pkg-config
  • Configure the environment
    • ./configure --with-libdir=/lib/x86_64-linux-gnu
  • Compile the module
    • make all -j 5
  • Install the module
    • sudo make install
    • You should get output indicating that the module was installed to an extensions directory, for example /opt/binamit/php/lib/php/extensions/
  • Edit php.ini
    • Use your text editor of choice to edit /opt/bitnami/php/etc/php.ini . I like vim
    • sudo vim /opt/bitnami/php/etc/php.ini
    • Add a line indicating the new module. It can go anywhere in the file. I put mine right next to the mongo.so instruction.
      • extension=mongodb.so
    • Save the file and exit
  • Restart the Bitnami stack
  • Verify successful installation using php -m and grep

Example:

bitnami@ubuntu:~/mongo-php-drivers$ php -m | grep mongo
mongo
mongodb