Learn about Centmin Mod LEMP Stack today
Register Now

PHP-FPM error notice after upgrading php to 5.6

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by arlon, Jul 26, 2016.

  1. arlon

    arlon Member

    73
    5
    8
    Feb 20, 2016
    Ratings:
    +10
    Local Time:
    4:15 PM
    1.10.1
    10.0
    hi i get the following error after upgrading php from 5.4 to 5.6

    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/geoip.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/geoip.so: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/mongo.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/mongo.so: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP 5.6.24 (cli) (built: Jul 26 2016 02:09:45)

    how to fix the error? do i need mongo and geoip?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    • What version of Centmin Mod ? 123.08stable or 123.09beta01 ? Was it fresh install or upgrade ? How long ago did you install Centmin Mod ? There's numerous code changes, bug fixes over time, so ensure you have latest Centmin Mod code installed by upgrading your Centmin Mod code as instructed below.
    • What version of PHP used ? Did you upgrade or downgrade PHP recently ?
    • If you upgraded and you get some PHP warnings that some PHP extensions are unable to load, all you need to do is delete the relevant *.ini files for them and then reinstall if you require the PHP extension
    Example of error on restart PHP-FPM
    Code (Text):
    fpmrestart
    Gracefully shutting down php-fpm . done
    Starting php-fpm [06-Nov-2014 01:25:37] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20140815/geoip.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20140815/geoip.so: cannot open shared object file: No such file or directory in Unknown on line 0
    [06-Nov-2014 01:25:37] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20140815/igbinary.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20140815/igbinary.so: cannot open shared object file: No such file or directory in Unknown on line 0
    [06-Nov-2014 01:25:37] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20140815/imagick.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20140815/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
    [06-Nov-2014 01:25:37] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20140815/memcache.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20140815/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
    [06-Nov-2014 01:25:37] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20140815/memcached.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20140815/memcached.so: cannot open shared object file: No such file or directory in Unknown on line 0
    done
    

    find the paths to the *.ini files
    Code (Text):
    php --ini 2>/devnull
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/custom_php.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/memcache.ini,
    /etc/centminmod/php.d/memcached.ini,
    /etc/centminmod/php.d/zendopcache.ini
    

    delete ones that are reported as unable to load so if geoip.so, igbinary.so, imagick.so, memcache.so and memcached.so are reported as unable to load, remove their respective *.ini files
    Code (Text):
    rm -rf /etc/centminmod/php.d/geoip.ini
    rm -rf /etc/centminmod/php.d/igbinary.ini
    rm -rf /etc/centminmod/php.d/imagick.ini
    rm -rf /etc/centminmod/php.d/memcache.ini
    rm -rf /etc/centminmod/php.d/memcached.ini
    

    in your case redis can be reinstalled in 123.09beta01 via menu option 13 and mongodb as disabled by default in later builds so you can just remove the *.ini file for mongodb if you don't use it.
    Code (Text):
    rm -rf /etc/centminmod/php.d/mongodb.ini
    nprestart
    

    then restart PHP-FPM again
    Code (Text):
    fpmrestart
    Gracefully shutting down php-fpm . done
    Starting php-fpm  done
    

    Code (Text):
    php -v
    PHP 7.0.0-dev (cli) (built: Nov  6 2014 00:54:07)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.8.0-dev, Copyright (c) 1998-2014 Zend Technologies
        with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    


    Manually reinstall PHP extension



    For reported PHP extensions that do not load, i.e. "PHP Startup: Unable to load dynamic" and references PHPEXTENSIONNAME.so, some can be installed again via centmin.sh menu. For instance menu options 7, 9, 10, 12, 15, 18, and 19.

    for 123.08stable
    Code (Text):
    --------------------------------------------------------
    Centmin Mod 1.2.3-eva2000.08
    --------------------------------------------------------
                       Centmin Mod Menu       
    --------------------------------------------------------
    1).  Centmin Install
    2).  Add Nginx vhost domain
    3).  NSD setup domain name DNS
    4).  Nginx Upgrade / Downgrade
    5).  PHP Upgrade / Downgrade
    6).  XCache Re-install
    7).  APC Cache Re-install
    8).  XCache Install
    9).  APC Cache Install
    10). Memcached Server Re-install
    11). MariaDB 5.2, 5.5, 10 Upgrade Sub-Menu
    12). Zend OpCache Install/Re-install
    13). Install ioping.sh vbtechsupport.com/1239/
    14). SELinux disable
    15). Install/Re-install ImageMagick PHP Extension
    16). Change SSHD Port Number
    17). Multi-thread compression: pigz,pbzip2,lbzip2,p7zip etc
    18). Suhosin PHP Extension install
    19). Install FFMPEG and FFMPEG PHP Extension
    20). NSD Re-install
    21). Update - Nginx + PHP-FPM + Siege
    22). Add Wordpress Nginx vhost + WP Super Cache
    23). Exit
    --------------------------------------------------------
    Enter option [ 1 - 23 ]
    --------------------------------------------------------
    


    for 123.09beta01 - menu options 7, 9, 10, 12, 13 (for redis), 15, 18, and 19 are relevant menu options that can be used only if the specific PHP extension is reporting as unable to load
    Code (Text):
    --------------------------------------------------------
         Centmin Mod Menu 123.09beta01 centminmod.com
    --------------------------------------------------------
    1).  Centmin Install
    2).  Add Nginx vhost domain
    3).  NSD setup domain name DNS
    4).  Nginx Upgrade / Downgrade
    5).  PHP Upgrade / Downgrade
    6).  XCache Re-install
    7).  APC Cache Re-install
    8).  XCache Install
    9).  APC Cache Install
    10). Memcached Server Re-install
    11). MariaDB 5.2/5.5 & 10.x Upgrade Sub-Menu
    12). Zend OpCache Install/Re-install
    13). Install/Reinstall Redis PHP Extension
    14). SELinux disable
    15). Install/Reinstall ImagicK PHP Extension
    16). Change SSHD Port Number
    17). Multi-thread compression: pigz,pbzip2,lbzip2...
    18). Suhosin PHP Extension install
    19). Install FFMPEG and FFMPEG PHP Extension
    20). NSD Install/Re-Install
    21). Update - Nginx + PHP-FPM + Siege
    22). Add Wordpress Nginx vhost + Cache Plugin
    23). Update Centmin Mod Code Base
    24). Exit
    --------------------------------------------------------
    Enter option [ 1 - 24 ]
    


    Upgrading Centmin Mod Code to Latest Version



    Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches.

    Centmin Mod LEMP stack's script code is constantly updated for improvements, bug fixes and security fixes so keeping the Centmin Mod code up to date is important. With Centmin Mod 1.2.3-eva2000.08) (123.08stable) and higher releases, a newly added centmin.sh menu option 23 allows much easier code updates and version branch swicthing via Git backed environment you can setup. For full details read the following links:
    Upgrading Centmin Mod involves 2 parts.
    1. Upgrading the actual Centmin Mod code outlined at Upgrade Centmin Mod. This is heart of Centmin Mod where the code is the engine that runs centmin.sh shell based menu and all the automation you're accustomed to. You can easily update within a Centmin Mod version branch or switch version branches via centmin.sh menu option 23 outlined here.
    2. Upgrade software that Centmin Mod installed or manages. For this part following outline at How to upgrade Centmin Mod software installed on your server.
     
    Last edited: Jul 26, 2016
  3. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    i'd keep geoip via 123.09beta01 menu option 13 to reinstall

    if you don't use mongodb, just remove the *.ini file named for it which you can find the path via php --ini command

    Code (Text):
    rm -rf /etc/centminmod/php.d/mongodb.ini
    nprestart
     
  4. arlon

    arlon Member

    73
    5
    8
    Feb 20, 2016
    Ratings:
    +10
    Local Time:
    4:15 PM
    1.10.1
    10.0
    im using latest 123.08stable and has been using it since march, it upgrading from php 5.4 to 5.6.24
    why mongo and geoip is not installed?
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    Probably some bug as the routine backported from 123.09beta01 and that is the one with improved routines most likely.

    Or you can troubleshooting investigating the php upgrade log. Every centmin.sh menu option has a full server log created with time stamped file name at /root/centminlogs. You can check that specific error log for clues or copy and paste log contents and post to pastebin.com or gist.github.com for sharing.

    Use this command to list all logs in /root/centminlogs in date descending order so most recent logs are at bottom
    Code (Text):
    ls -lAhrt /root/centminlogs


    For example
    Code (Text):
    ls -lAhrt /root/centminlogs
    
    -rw-r--r-- 1 root root 1.8M Sep 19 05:58 centminmod_1.2.3-eva2000.08_190915-055517_php_upgrade.log
    -rw-r--r-- 1 root root 1.8M Sep 19 06:22 centminmod_1.2.3-eva2000.08_190915-061910_php_upgrade.log
    -rw-r--r-- 1 root root 939K Sep 19 06:28 centminmod_1.2.3-eva2000.08_190915-062728_php_upgrade.log
    -rw-r--r-- 1 root root 1.8M Sep 19 06:32 centminmod_1.2.3-eva2000.08_190915-062943_php_upgrade.log
    -rw-r--r-- 1 root root 1.8M Sep 19 06:53 centminmod_1.2.3-eva2000.08_190915-065026_php_upgrade.log
    -rw-r--r-- 1 root root 1.8M Sep 19 07:14 centminmod_1.2.3-eva2000.08_190915-065820_php_upgrade.log
    


    Also did you update 123.08stable via centmin.sh menu option 23 submenu option 2 before upgrading PHP to ensure you're running latest centmin mod code ?
     
  6. arlon

    arlon Member

    73
    5
    8
    Feb 20, 2016
    Ratings:
    +10
    Local Time:
    4:15 PM
    1.10.1
    10.0
    yess i have latest 123.08stable, up to date
    i will see my upgrade log
     
  7. arlon

    arlon Member

    73
    5
    8
    Feb 20, 2016
    Ratings:
    +10
    Local Time:
    4:15 PM
    1.10.1
    10.0
    this is my error log
    Code:
    https://gist.github.com/anonymous/ca947554c37b7cc3f27a101a6e65b016#file-gistfile1-txt
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    looks like php upgrade's auto php extension reinstall didn't complete as it exited after mongodb tarball failed to download
    Code (Text):
    (B[m*************************************************
    [1;32;40m* Installing MongoDB PHP extension
    (B[m*************************************************
    Downloading MongoDB PHP extension...
    [1;33;40mCheck if mongo-php-1.6.9.tgz exists
    (B[m[1;32;40mDownloading MongoDB PHP extension..
    (B[m[1;33;40mDownload mongo-php-1.6.9.tgz ...
    (B[mError: mongo-php-1.6.9.tgz not found !!! Downloading now......
    https://codeload.github.com/mongodb/mongo-php-driver/tar.gz/1.6.9:
    2016-07-26 02:12:24 ERROR 404: Not Found.
    [1;32;40mError: mongo-php-1.6.9.tgz download failed.
    (B[mcheck Centmin Mod log for details at /root/centminlogs/
    Aborting script...
    
    Total PHP Upgrade Time: 812.618261398 seconds
    


    123.08stable has an outdated mongodb routine as the driver extension for that was updated in 123.09beta01

    so look at disabling on routine in 123.08stable and just get folks to update to 123.09beta01 if they need php to talk with mongodb servers

    but latest centmin mod 123.08stable has php mongodb disabled by default
    Code (Text):
    PHPMONGODB='n'
    

    so just removing the mongodb.ini file should be enough to disable it unless you need php mongodb php driver extension support
     
  9. arlon

    arlon Member

    73
    5
    8
    Feb 20, 2016
    Ratings:
    +10
    Local Time:
    4:15 PM
    1.10.1
    10.0
    can i upgrade from the same php version? recompile php 5.6.24 to 5.6.24 ?
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    yup that's what centmin.sh menu option 5 is intended for recompile, upgrade or downgrades :)
     
    • Like Like x 1
  11. arlon

    arlon Member

    73
    5
    8
    Feb 20, 2016
    Ratings:
    +10
    Local Time:
    4:15 PM
    1.10.1
    10.0
    my server now redis installed that redis was not installed on my previous php 5.4
    so i running opcache, memcache, memcached, memcached server, redis
    do i need them all? what should i disable? because their function is the same for caching
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    besides memcached server and zend opcache which you should install, rest of php extensions which are needed to communicate with memcached server and redis server if installed

    not need to disable if they are installed.
     
    • Like Like x 1
  13. arlon

    arlon Member

    73
    5
    8
    Feb 20, 2016
    Ratings:
    +10
    Local Time:
    4:15 PM
    1.10.1
    10.0
    hi i have another problem
    after recompile php,, all centminmod instalation removed

    Code:
    centminmod]# centmin
    shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    pushd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
    bash: centmin.sh: No such file or directory
    
    how to reinstall centminmod?
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    no that just means after you ran centmin.sh menu option 23 submenu option 2, you did not exit centmin.sh and re-change back into centminmod directory to re-run centmin.sh or log out of ssh session and log back in then run centmin command

    see Upgrade Centmin Mod - CentminMod.com LEMP Nginx web stack for CentOS

     
    • Like Like x 1
  15. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  16. arlon

    arlon Member

    73
    5
    8
    Feb 20, 2016
    Ratings:
    +10
    Local Time:
    4:15 PM
    1.10.1
    10.0
    great support, thank you
     
    • Like Like x 1
  17. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:15 PM
    Nginx 1.13.x
    MariaDB 5.5