Join the community today
Register Now

Potential bug with MongoDB PHP Extension install process

Discussion in 'Bug Reports' started by ct_roy, Jun 22, 2020.

Tags:
  1. ct_roy

    ct_roy Premium Member Premium Member

    55
    9
    8
    Jun 21, 2020
    Ratings:
    +17
    Local Time:
    10:38 AM
    1.17.10
    10.3.22
    Hi folks,
    So I managed to get xhprof and xhgui setup on one of my test servers but hit one big roadblock along the way which might be a bug (or something else I did wrong!) so I thought it best for me to report it here first.


    Steps to recreate:
    1.) I followed these instructions from @eva2000 (thanks!) to install the MongoDB PHP extension and MongoDB server.

    I fell at the first hurdle though as the extension installation failed during the PHP recompile. Here's the relevant output from php upgrade log that I found:

    Code:
    *************************************************
    [1;32;40m* Installing MongoDB PHP extension
    (B[m*************************************************
    Downloading MongoDB PHP extension...
    [1;33;40mCheck if mongodb-1.6.1.tgz exists
    (B[m[1;32;40mCompiling PHP mongo-php-1.6.1 extension...
    (B[m/svr-setup
    cd /svr-setup
    inc/mongodb.inc: line 36: cd: /svr-setup/mongodb-1.6.1: No such file or directory
    make: *** No rule to make target `clean'.  Stop.
    Cannot find config.m4.
    Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module
    
    inc/mongodb.inc: line 44: ./configure: No such file or directory
    make: *** No targets specified and no makefile found.  Stop.
    make: *** No rule to make target `install'.  Stop.
    grep: /etc/centminmod/php.d/mongodb.ini: No such file or directory
    [1;33;40mAuto reinstalling previously detected Zopfli PHP extension
    (B[m[1;33;40mAuto reinstalling previously detected brotli PHP extension
    (B[m[1;33;40mAuto reinstalling previously detected lz4 PHP extension
    (B[m[1;33;40mAuto reinstalling previously detected lzf PHP extension
    (B[m[1;33;40mAuto reinstalling previously detected zstd PHP extension
    (B[m[1;33;40mAuto reinstalling previously detected mailparse extension
    (B[mPHP Warning:  PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so (/usr/local/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    7.3
    0
    
    Running this post recompile:
    Code (Text):
    php --ri mongodb
    


    would give the following error:
    Code:
    PHP Warning:  PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so (/usr/local/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    7.3
    
    I fixed the issue as follows:

    Code (Text):
    cd /srv-setup/inc/
    tar -zxvf mongo-php-1.6.9.tgz
    tar -zxvf mongodb-1.6.1.tgz
    


    and then re-following the original steps.

    Did I miss something not documented in the original install process or is this a bug?


    Version info
    • CentOS Version: 7.7.1908
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.17.10
    • PHP Version Installed: 7.3.19
    • MariaDB MySQL Version Installed: 10.3.22
    • When was last time updated Centmin Mod code base ? : today
    • Persistent Config:
      Code (Text):
      MARCH_TARGETNATIVE='n'
      LETSENCRYPT_DETECT='y'
      PHPMONGODB='y'
      

     
  2. eva2000

    eva2000 Administrator Staff Member

    55,796
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    7:38 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yup you ran into a bug. I've updated 123.09beta01 with a fix so you can run cmupdate to update your local code and re-run centmin.sh menu option 5 and it should work. I've updated mongodb PHP extension from 1.6.1 to 1.7.4 too
     
  3. ct_roy

    ct_roy Premium Member Premium Member

    55
    9
    8
    Jun 21, 2020
    Ratings:
    +17
    Local Time:
    10:38 AM
    1.17.10
    10.3.22
    Awesome! Thanks for the super quick fix @eva2000 - you do amazing work :)