Join the community today
Become a Member

PHP-FPM PHP Warning: PHP Startup: Unable to load dynamic library

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Jota, Oct 11, 2016.

Tags:
  1. Jota

    Jota Member

    68
    16
    8
    Oct 9, 2014
    Ratings:
    +18
    Local Time:
    1:56 PM
    Hi, I just have a new fresh stable install and I see some errors after upgrading to php7.

    After creating a WP site in menu #22 I see this errors:

    Code:
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/mongo.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20151012/mongo.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-20151012/redis.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20151012/redis.so: cannot open shared object file: No such file or directory in Unknown on line 0
    But I upgraded it all and still not abble to fix it, what to do and how to fix ?

    thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    28,929
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    1:56 PM
    Nginx 1.13.x
    MariaDB 5.5
    • 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
    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 ]
    


    So for you remove mongodb.ini and redis.ini and run centmin.sh menu option 13 to reinstall redis extension and just leave mongodb disabled. These niggle issues for PHP 7 are fixed in 123.09beta01 but not in 123.08stable
     
    • Like Like x 1
  3. Jota

    Jota Member

    68
    16
    8
    Oct 9, 2014
    Ratings:
    +18
    Local Time:
    1:56 PM
    Worked fine, but I can't get APC working with PHP7, is this correct ? I mean, doesn't APC wortk with PHP 7.0.0 ? thanks mate !
     
  4. eva2000

    eva2000 Administrator Staff Member

    28,929
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    1:56 PM
    Nginx 1.13.x
    MariaDB 5.5
    APC outdated and doesn't support PHP7. Best performance is leave it to default Zend Opcache
     
    • Like Like x 1
  5. Jota

    Jota Member

    68
    16
    8
    Oct 9, 2014
    Ratings:
    +18
    Local Time:
    1:56 PM
    Understand, thanks mastah ! ;)