Want more timely Centmin Mod News Updates?
Become a Member

Nginx PHP Warning: PHP Startup: Unable to load dynamic library

Discussion in 'Install & Upgrades or Pre-Install Questions' started by computer19852007, Mar 2, 2018.

  1. computer19852007

    computer19852007 Member

    80
    8
    8
    Jun 25, 2014
    Ratings:
    +8
    Local Time:
    9:31 PM
    Centmin Mod 1.2.3-eva2000.06
    MariaDB 5.5.34
    • CentOS Version: CentOS 6 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: nginx/1.13.3
    • PHP Version Installed: PHP 7.0.26
    i see this tips: 39. Does Centmin Mod Installed Nginx Support Nginx Dynamic Module Loading ? in FAQ:
    Code:
    ls -lAhrt /usr/local/nginx/modules
    total 22M
    -rwxr-xr-x 1 root root 143K Jun 18 19:02 ngx_http_image_filter_module.so
    -rwxr-xr-x 1 root root 106K Jun 18 19:02 ngx_http_brotli_static_module.so
    -rwxr-xr-x 1 root root 208K Jun 18 19:02 ngx_http_brotli_filter_module.so
    -rwxr-xr-x 1 root root  17M Jun 18 19:02 ngx_pagespeed.so
    -rwxr-xr-x 1 root root 149K Jun 18 19:02 ngx_http_fancyindex_module.so
    -rwxr-xr-x 1 root root 751K Jun 18 19:02 ngx_http_set_misc_module.so
    -rwxr-xr-x 1 root root 657K Jun 18 19:02 ngx_http_echo_module.so
    -rwxr-xr-x 1 root root 279K Jun 18 19:02 ngx_http_redis2_module.so
    -rwxr-xr-x 1 root root 396K Jun 18 19:02 ngx_http_memc_module.so
    -rwxr-xr-x 1 root root 395K Jun 18 19:02 ngx_http_srcache_filter_module.so
    -rwxr-xr-x 1 root root 280K Jun 18 19:02 ngx_http_headers_more_filter_module.so
    -rwxr-xr-x 1 root root 555K Jun 18 19:02 ngx_stream_module.so
    but when i type this command, it only show:
    Code:
    ls -lAhrt /usr/local/nginx/modules
    
    total 48K
    -rwxr-xr-x 1 root root 25K Mar  2 16:17 ngx_http_geoip_module.so
    -rwxr-xr-x 1 root root 20K Mar  2 16:17 ngx_stream_geoip_module.so
    
    
    and when i have restart and is show error:
    Code:
    # nprestart
    
    Starting php-fpm [02-Mar-2018 16:21:40] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/memcache.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20151012/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
    [02-Mar-2018 16:21:40] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/memcached.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20151012/memcached.so: cannot open shared object file: No such file or directory in Unknown on line 0
    Please Help me
     
  2. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    12:31 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    did you do as instructions in FAQ 39 and enable dynamic nginx modules in persistent config file at /etc/centminmod/custom_config.inc BEFORE recompiling nginx via centmin.sh menu option 4 ?

    post the contents of your /etc/centminmod/custom_config.inc file
    Code (Text):
    cat /etc/centminmod/custom_config.inc
    


    • 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. In your case it is memcache PHP extension so rerunning centmin.sh menu option 10 will reinstall it
    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
    

    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.
     
  3. computer19852007

    computer19852007 Member

    80
    8
    8
    Jun 25, 2014
    Ratings:
    +8
    Local Time:
    9:31 PM
    Centmin Mod 1.2.3-eva2000.06
    MariaDB 5.5.34
    Code:
    # Nginx Dynamic Module Switches
    NGXDYNAMIC_NJS='n'
    NGXDYNAMIC_XSLT='y'
    NGXDYNAMIC_PERL='n'
    NGXDYNAMIC_IMAGEFILTER='y'
    NGXDYNAMIC_GEOIP='n'
    NGXDYNAMIC_STREAM='y'
    NGXDYNAMIC_STREAMGEOIP='y'  # nginx 1.11.3+ option http://hg.nginx.org/nginx/rev/558db057adaa
    NGXDYNAMIC_STREAMREALIP='y' # nginx 1.11.4+ option http://hg.nginx.org/nginx/rev/9cac11efb205
    NGXDYNAMIC_HEADERSMORE='y'
    NGXDYNAMIC_SETMISC='y'
    NGXDYNAMIC_ECHO='y'
    NGXDYNAMIC_LUA='n'          # leave disabled due to bug https://github.com/openresty/lua-nginx-module/issues/715
    NGXDYNAMIC_SRCCACHE='y'
    NGXDYNAMIC_DEVELKIT='n'     # leave disabled as it requires lua nginx module as dynamic but it has a bug in lua nginx
    NGXDYNAMIC_MEMC='y'
    NGXDYNAMIC_REDISTWO='n'
    NGXDYNAMIC_NGXPAGESPEED='n'
    NGXDYNAMIC_BROTLI='y'
    NGXDYNAMIC_FANCYINDEX='y'
    NGXDYNAMIC_HIDELENGTH='y'
    
    NGINX_LIBBROTLI=n
    NGINX_PAGESPEED=n
    PHP: 7.0.26 - I have upgrade php 5x to PHP 7.x


    I have run command and it show error.
    command not foundtom_config.inc: line 22:
    configure: error: in `/svr-setup/ccache-3.4.1':
    configure: error: cannot compute suffix of object files: cannot compile
    See `config.log' for more details
    make: *** No targets specified and no makefile found. Stop.
    make: *** No rule to make target `install'. Stop.


    Code:
    [[email protected] centminmod]# ./centmin.sh
    : command not foundtom_config.inc: line 22:
    install ccache 3.4.1
    make: *** No rule to make target `clean'.  Stop.
    configure: error: in `/svr-setup/ccache-3.4.1':
    configure: error: cannot compute suffix of object files: cannot compile
    See `config.log' for more details
    make: *** No targets specified and no makefile found.  Stop.
    make: *** No rule to make target `install'.  Stop.
    
    completed update to ccache 3.4.1
    Set cache size limit to 2.5 GB
    : command not foundtom_config.inc: line 22:
    
    /etc/init.d ~
    ~
    : command not foundtom_config.inc: line 22:
    --------------------------------------------------------
         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
     
  4. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    12:31 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  5. computer19852007

    computer19852007 Member

    80
    8
    8
    Jun 25, 2014
    Ratings:
    +8
    Local Time:
    9:31 PM
    Centmin Mod 1.2.3-eva2000.06
    MariaDB 5.5.34
    Thank you...i have fixed to your tuts... and i re-run centmin.sh...it show error:

    Code:
    [17:31][[email protected] centminmod]# ./centmin.sh
    : command not foundtom_config.inc: line 22:
    : command not foundtom_config.inc: line 22:
    
    /etc/init.d /usr/local/src/centminmod
    /usr/local/src/centminmod
    : command not foundtom_config.inc: line 22:
     
  6. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    12:31 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    that is clearly incorrect filename foundtom_config.inc as no such file in centmin mod!

    make sure your ssh client app is set to character encoding = UTF-8

    run these command to run centmin.sh in debug mode and saved contents to /root/centminlogs/centmin-debug.txt. wait until you return to command prompt for completion of debug mode
    Code (Text):
    cmupdate
    cd /usr/local/src/centminmod
    echo 24 | bash -x centmin.sh 2>&1 | sed -e "s|$(hostname -f)|hostname|g" -e "s|$(hostname -s)|hostname|g" | tee /root/centminlogs/centmin-debug.txt
    

    then post the contents of /root/centminlogs/centmin-debug.txt to pastebin.com or gist.github.com and share the link here or private message me with the link
     
  7. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    12:31 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    fyi made slight revision to cmd
    Code (Text):
    cmupdate
    cd /usr/local/src/centminmod
    echo 24 | bash -x centmin.sh 2>&1 | sed -e "s|$(hostname -f)|hostname|g" -e "s|$(hostname -s)|hostname|g" | tee /root/centminlogs/centmin-debug.txt
    
     
  8. computer19852007

    computer19852007 Member

    80
    8
    8
    Jun 25, 2014
    Ratings:
    +8
    Local Time:
    9:31 PM
    Centmin Mod 1.2.3-eva2000.06
    MariaDB 5.5.34
  9. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    12:31 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    ok found the problem in debug log seems you have an empty line break in /etc/centminmod/custom_config.inc on line 22 cause some problem - did you edit that file using linux text editor like vi or nano ? if you used local pc text editor it might not have been saved as unix/UTF-8 encoded file
    Code (Text):
    ++ source /etc/centminmod/custom_config.inc
    +++ NGXDYNAMIC_NJS=$'n\r'
    +++ NGXDYNAMIC_XSLT=$'y\r'
    +++ NGXDYNAMIC_PERL=$'n\r'
    +++ NGXDYNAMIC_IMAGEFILTER=$'y\r'
    +++ NGXDYNAMIC_GEOIP=$'n\r'
    +++ NGXDYNAMIC_STREAM=$'y\r'
    +++ NGXDYNAMIC_STREAMGEOIP=y
    +++ NGXDYNAMIC_STREAMREALIP=y
    +++ NGXDYNAMIC_HEADERSMORE=$'y\r'
    +++ NGXDYNAMIC_SETMISC=$'y\r'
    +++ NGXDYNAMIC_ECHO=$'y\r'
    +++ NGXDYNAMIC_LUA=n
    +++ NGXDYNAMIC_SRCCACHE=$'y\r'
    +++ NGXDYNAMIC_DEVELKIT=n
    +++ NGXDYNAMIC_MEMC=$'y\r'
    +++ NGXDYNAMIC_REDISTWO=$'n\r'
    +++ NGXDYNAMIC_NGXPAGESPEED=$'n\r'
    +++ NGXDYNAMIC_BROTLI=$'y\r'
    +++ NGXDYNAMIC_FANCYINDEX=$'y\r'
    +++ NGXDYNAMIC_HIDELENGTH=$'y\r'
    +++ $'\r'
    /etc/centminmod/custom_config.inc: line 22:
    : command not found
    

    on local text editors save as linux/unix UTF-8 encoding or edit via vi or nano the /etc/centminmod/custom_config.inc persistent config file

    for now use dos2unix to see if converting the file will remove those \r line breaks which were probably added by windows or pc editor
    Code (Text):
    dos2unix /etc/centminmod/custom_config.inc
    

    might need to do something like this by default to save some problems
     
    • Like Like x 1
  10. computer19852007

    computer19852007 Member

    80
    8
    8
    Jun 25, 2014
    Ratings:
    +8
    Local Time:
    9:31 PM
    Centmin Mod 1.2.3-eva2000.06
    MariaDB 5.5.34
    Thank you very much, I have fixed.
     
    • Like Like x 1
..