Want to subscribe to topics you're interested in?
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

    36,438
    7,997
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,317
    Local Time:
    12:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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.0.repo which following contents:
    Code (Text):
    [mongodb-org-4.0]
    name=MongoDB Repository
    baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
    gpgcheck=1
    enabled=1
    gpgkey=https://www.mongodb.org/static/pgp/server-4.0.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
     
    • Like Like x 1
..
Thread Status:
Not open for further replies.