Get the most out of your Centmin Mod LEMP stack
Become a Member

Install PHP-FPM MongoDB Server & mongodb PHP Extension Installation on CentOS 7.5 64bit

Discussion in 'Centmin Mod Insights' started by eva2000, Jul 13, 2018.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    53,178
    12,112
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,647
    Local Time:
    10:57 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    I haven't used MongoDB before but now I have looked into it as it's needed for using Tideways XHProf profiler for PHP 7 and required me to install MongoDB server and mongodb PHP extension when using it with xhGUI panel.

    Below guide is on how to install mongodb PHP extension for Centmin Mod 123.09beta01 and newer versions and how to install MongoDB server on CentOS 7.5 64bit OS.


    How To Install MongoDB PHP Extension



    On PHP 7.2.7 systems, I enabled in persistent config file /etc/centminmod/custom_config.inc the variable
    Code (Text):
    PHPMONGODB='y'
    

    Then recompiled PHP via centmin.sh menu option 5 and mongodb PHP extension will now be loaded with PHP everytime you recompile PHP.

    checking mongodb PHP extension details which is same info if you loaded phpinfo page and checked mongodb section
    Code (Text):
    php --ri mongodb
    
    mongodb
    
    MongoDB support => enabled
    MongoDB extension version => 1.5.1
    MongoDB extension stability => stable
    libbson bundled version => 1.11.0
    libmongoc bundled version => 1.11.0
    libmongoc SSL => enabled
    libmongoc SSL library => OpenSSL
    libmongoc crypto => enabled
    libmongoc crypto library => libcrypto
    libmongoc crypto system profile => disabled
    libmongoc SASL => enabled
    libmongoc ICU => enabled
    libmongoc compression => enabled
    libmongoc compression snappy => disabled
    libmongoc compression zlib => enabled
    
    Directive => Local Value => Master Value
    mongodb.debug => no value => no value
    


    How To Install MongoDB Server On CentOS 7 64bit



    MongoDB server will be installed from official MongoDB YUM repository which only supports 64bit systems.

    Create the repo file /etc/yum.repos.d/mongodb-org-4.2.repo which following contents:
    Code (Text):
    [mongodb-org-4.2]
    name=MongoDB Repository
    baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/
    gpgcheck=1
    enabled=1
    gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
    

    Then do yum install
    Code (Text):
    yum -y install mongodb-org
    

    which will install the following YUM packages
    • mongodb-org
    • mongodb-org-mongos
    • mongodb-org-server
    • mongodb-org-shell
    • mongodb-org-tools
    Start and ensure MongoD service starts on reboot
    Code (Text):
    service mongod start
    chkconfig mongod on
    

    Checking MongoDB version via mongo shell
    Code (Text):
    mongo --version
    MongoDB shell version v4.0.0
    git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51
    OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
    allocator: tcmalloc
    modules: none
    build environment:
       distmod: rhel70
       distarch: x86_64
       target_arch: x86_64
    

    Then start reading MongoDB manual :)

    So my Tideways XHProf PHP profiling + xhGUI adventures begin - setup on Centmin Mod 123.09beta01 Nginx/PHP-FPM + MongoDB 4.0.0 server :)

    xhgui-01.png
     
    Last edited: Jun 22, 2020
Thread Status:
Not open for further replies.