Learn about Centmin Mod LEMP Stack today
Become a Member

Redis.so reported missing after upgrading from php 5.4 to php 5.6.35

Discussion in 'Install & Upgrades or Pre-Install Questions' started by jellday, Apr 16, 2018.

  1. jellday

    jellday Member

    44
    3
    8
    May 31, 2014
    Ratings:
    +5
    Local Time:
    7:32 PM
    1.4.6
    5.5
    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 6 32bit
    • Centmin Mod Version Installed: 123.08stable
    • Nginx Version Installed: 1.12.2
    • PHP Version Installed: 5.6.35
    • When was last time updated Centmin Mod code base ? : just now
    • Persistent Config: No


      I upgraded the PHP and then gave me the error:
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/redis.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/redis.so: cannot open shared object file: No such file or directory in Unknown on line 0

    I do find a redis.so under a different folder:
    /usr/local/lib/php/extensions/no-debug-non-zts-20100525/redis.so

    And if I copy that file to the missing one, it will report mismatch error:
    HP Warning: PHP Startup: redis: Unable to initialize module
    Module compiled with module API=20100525
    PHP compiled with module API=20131226
    These options need to match
    in Unknown on line 0

    Please help.
     
  2. pamamolf

    pamamolf Well-Known Member

    3,117
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    1:32 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    There is an automated routine that will take care that when you update php....

    Maybe autodetection for that missing on a specific version?

    From which version did you try to update and to which new version?
     
  3. eva2000

    eva2000 Administrator Staff Member

    36,884
    8,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,435
    Local Time:
    9:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Automated redis php extension routine was only perfected in centmin mod 123.09beta01 and higher and not in 123.08stable. With 123.08stable try deleting redis php extensions redis.ini file which you can find in output for command
    Code (Text):
    php --ini
    

    and then re-running centmin.sh menu option 5 to recompile php 5.6.35
     
  4. jellday

    jellday Member

    44
    3
    8
    May 31, 2014
    Ratings:
    +5
    Local Time:
    7:32 PM
    1.4.6
    5.5
    I got the following:

    Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20131226/
    Installing header files: /usr/local/include/php/
    grep: /etc/centminmod/php.d/apc.ini: No such file or directory
    service php-fpm reload
    Reload service php-fpm done
    Check if phpredis-2.2.7.tgz exists
    Compiling PHP redis-2.2.7 extension...
    /svr-setup/igbinary-igbinary-a0316ff
    cd /svr-setup
    inc/redis.inc: line 61: cd: /svr-setup/phpredis-2.2.7: 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/redis.inc: line 67: ./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/redis.ini: No such file or directory
    service php-fpm restart
    Gracefully shutting down php-fpm ................................... failed. Use force-exit
    Starting php-fpm [18-Apr-2018 02:18:36] NOTICE: PHP message: PHP Warning: PHP Startup: redis: Unable to initialize module
    Module compiled with module API=20100525
    PHP compiled with module API=20131226
    These options need to match
    in Unknown on line 0
    done
     
  5. eva2000

    eva2000 Administrator Staff Member

    36,884
    8,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,435
    Local Time:
    9:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Are you running latest Centmin Mod 123.08stable code which was updated today ? For 123.08stable that means centmin.sh menu option 23 submenu option 2 (if you previously ran submenu option 1) first, then exit centmin.sh, re-enter /usr/local/src/centminmod and re-run centmin.sh menu

    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 or you can run cmupdate command that was recently added.

    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:

    After updating to latest 123.08stable code, did you remove the php extension ini settings files which have errors BEFORE you re-ran centmin.sh menu option 5 recompile of PHP 5.6.35 ?
    Code (Text):
    rm /etc/centminmod/php.d/apc.ini
    rm /etc/centminmod/php.d/redis.in
    


    Also might want to use CODE bbcode tags for posting output to keep formatting
     
  6. jellday

    jellday Member

    44
    3
    8
    May 31, 2014
    Ratings:
    +5
    Local Time:
    7:32 PM
    1.4.6
    5.5
    I tried again:
    Code:
    Updating Current Centmin Mod code branch via git
        cd /usr/local/src/centminmod
        git stash
        git pull
        chmod +x centmin.sh
    No local changes to save
    From https://github.com/centminmod/centminmod
       383b9b7..12d45da  123.08stable -> origin/123.08stable
       fc5004b..b292fac  123.09beta01 -> origin/123.09beta01
    Updating 383b9b7..12d45da
    Fast-forward
     inc/nginx_configure.inc |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    And deleted apc.ini and redis.ini, then reran the centmin.sh menu option 5, still the errors:

    Code:
    Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20131226/
    Installing header files:           /usr/local/include/php/
    grep: /etc/centminmod/php.d/apc.ini: No such file or directory
    service php-fpm reload
    Reload service php-fpm  done
    Check if phpredis-2.2.7.tgz exists
    Compiling PHP redis-2.2.7 extension...
    /svr-setup/igbinary-igbinary-a0316ff
    cd /svr-setup
    inc/redis.inc: line 61: cd: /svr-setup/phpredis-2.2.7: 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/redis.inc: line 67: ./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/redis.ini: No such file or directory
    service php-fpm restart
    Gracefully shutting down php-fpm ................................... failed. Use force-exit
    Starting php-fpm [18-Apr-2018 08:45:22] NOTICE: PHP message: PHP Warning:  PHP
     Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-
    20131226/redis.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/redis.so: 
    cannot open shared object file: No such file or directory in Unknown on line 0
     done
    
     
  7. eva2000

    eva2000 Administrator Staff Member

    36,884
    8,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,435
    Local Time:
    9:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Most of these issues are partially due to 123.08stable's upgrade routines not being as advanced or refined as 123.09beta01 which usually would take care of these issues automatically.

    Are you using APC Cache ? You need to switch to Zend Opcache with PHP 5.6.35 so try deleting any phpredis and apc files and directories in /svr-setup and redis.ini first
    Code (Text):
    cd /svr-setup
    rm -rf /svr-setup/phpredis-*
    rm -rf /etc/centminmod/php.d/redis.ini
    rm -rf /etc/centminmod/php.d/apc.ini
    

    Then try centmin.sh menu option 5 run and when prompted to install Zend Opcache answer yes = y. Then if still have issues, might need full php upgrade log to troubleshoot

    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.

    To troubleshoot, you need to check the the php upgrade logs at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the nginx_upgrade and php_upgrade logs. You can see full details at How to troubleshoot Centmin Mod initial install issues

    if you type this command it lists all logs in date ascending order so latest log at bottom
    Code (Text):
    ls -lArt /root/centminlogs

    so copy the entire contents of latest php_upgrade log to gist.github.com or pastebin.com

    you can use grep to filter the logs, i.e. look for nginx_upgrade or php in log name
    Code (Text):
    ls -lahrt /root/centminlogs/ | egrep 'nginx_upgrade|php_upgrade'
    

    Code (Text):
    ls -lahrt /root/centminlogs/ | egrep 'nginx_upgrade|php_upgrade'
    -rw-r--r--  1 root root  2.6M Oct  3 03:48 centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log
    -rw-r--r--  1 root root  664K Oct 12 09:24 centminmod_1.2.3-eva2000.09.001_121016-092406_nginx_upgrade.log
    

    So the last php upgrade log was named centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log and located at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log
    then use cat command to output the contents of that log.

    clear your ssh window buffer/screen and type
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_031016-034409_php_upgrade.log

    then select and copy and paste output to pastebin.com or gist.github.com file to share. If your SSH client's scroll buffer isn't large enough using cat might not output the entire log file contents, so you may need to download the log and use local text editor to open and copy and paste.

    so only need content of a specific log, in this case most recent php_upgrade.log logs
     
  8. jellday

    jellday Member

    44
    3
    8
    May 31, 2014
    Ratings:
    +5
    Local Time:
    7:32 PM
    1.4.6
    5.5
    No, I didnot use APC, and yes when I upgrade to 5.6.35 I chose Zend Opcache.
    The pastbin has a size limit of 512KB and the log file is 2MB, so I upload the file to here :
    百度网盘 请输入提取密码 pass: echj
    Let me know if the link is not working or cannot be downloaded.
     
  9. eva2000

    eva2000 Administrator Staff Member

    36,884
    8,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,435
    Local Time:
    9:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    try using gist.github.com for larger size limits
     
  10. jellday

    jellday Member

    44
    3
    8
    May 31, 2014
    Ratings:
    +5
    Local Time:
    7:32 PM
    1.4.6
    5.5
  11. eva2000

    eva2000 Administrator Staff Member

    36,884
    8,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,435
    Local Time:
    9:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Ok i updated 123.08stable code with backported routine from 123.09beta01 for more extended check to see if phpredis tarball and extracted directory exists. So use centmin.sh menu option 23 submenu option 2 + exit centmin.sh and cd into /usr/local/src/centminmod again re-run centmin.sh to update your local code

    or

    use below commands to do the same which doesn't require you to do the exit centmin.sh/cd and re-run centmin.sh steps. Also make a backup of your local Centmin Mod code to directory at /usr/local/src/centminmod-b4-gitpull just in case.
    Code (Text):
    cp -a /usr/local/src/centminmod /usr/local/src/centminmod-b4-gitpull
    cd /usr/local/src/centminmod
    git stash
    git pull
    ./centmin.sh
    

    select menu option 5 and re-try php upgrade
     
  12. jellday

    jellday Member

    44
    3
    8
    May 31, 2014
    Ratings:
    +5
    Local Time:
    7:32 PM
    1.4.6
    5.5
    I did the update and entered the folder before invoking centmin.sh. Then reupgraded php, still got the same "cannot open" error.
    The log file: Php upgrade issue
     
  13. eva2000

    eva2000 Administrator Staff Member

    36,884
    8,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,435
    Local Time:
    9:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    I think it's due to the php upgrade check i do which only reinstalls php extensions on major version switches i.e. PHP 5.4 to 5.5 to 5.6 etc. As you're already on 5.6, there is no major version change so no reinstall of php extensions like redis. So try downgrading to PHP 5.5.38 and then upgrading to PHP 5.6.35 - this time should work due to backported redis check fix i added to 123.08stable from 123.09beta01 code.

    In 123.09beta01 there is an extra option you can set in /etc/centminmod/custom_config.inc persistent config for variable AUTODETECPHP_OVERRIDE='y' which allow you to override and reinstall php extensions even if on same major version.
     
  14. jellday

    jellday Member

    44
    3
    8
    May 31, 2014
    Ratings:
    +5
    Local Time:
    7:32 PM
    1.4.6
    5.5
    Yeah, downgrade to 5.5.38 then upgrade to 5.6.35 works. Thank you !!!
     
    • Like Like x 1
  15. eva2000

    eva2000 Administrator Staff Member

    36,884
    8,074
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,435
    Local Time:
    9:32 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Glad to hear :)
     
..