Learn about Centmin Mod LEMP Stack today
Become a Member

PHP 7 upgrade Redis extension missing

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

  1. Rdurty2

    Rdurty2 Member

    38
    9
    8
    Oct 31, 2015
    Ratings:
    +12
    Local Time:
    7:50 AM
    1.11.4
    10.0.27
    I am currently on the stable branch and recently upgraded PHP from 5.6 to the latest version of 7.

    Everything went great but my Redis PHP extension is now missing and I cannot figure out how to get it installed and registered with PHP.

    I followed the guide on how to install the Redis server but that does not install the PHP extension.

    Any help is greatly appreciated!!
     
  2. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:50 PM
    Nginx 1.13.x
    MariaDB 5.5
    • For 123.08stable, you can remove the redis.ini settings file and then recompile php via centmin.sh menu option 5 to reinstall redis php extension. See below for specifics.
    • For 123.09beta01, there's dedicated redis php extension recompile option via centmin.sh menu option 13. Centmin Mod 123.08stable doesn't have such options.

    For 123.08stable only



    The command below lists all custom PHP extensions' ini file paths for extensions added by Centmin Mod specifically
    Code (Text):
    php --ini


    Find the /etc/centminmod/php.d/redis.ini path file and delete it and restart PHP-FPM service

    example output to find redis.ini path
    Code (Text):
    php --ini
    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/a_customphp.ini,
    /etc/centminmod/php.d/curlcainfo.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/mongodb.ini,
    /etc/centminmod/php.d/redis.ini,
    /etc/centminmod/php.d/suhosin.ini

    then delete redis.ini file
    Code (Text):
    rm /etc/centminmod/php.d/redis.ini
    

    restart PHP
    Code (Text):
    service php-fpm restart

    or with command shortcut
    Code (Text):
    fpmrestart

    Then for Centmin Mod 123.08stable only, run centmin.sh menu option 5 to recompile PHP to reinstall redis php extension. For 123.09beta01, there's dedicated redis php extension recompile option via centmin.sh menu option 13
     
  3. Rdurty2

    Rdurty2 Member

    38
    9
    8
    Oct 31, 2015
    Ratings:
    +12
    Local Time:
    7:50 AM
    1.11.4
    10.0.27
    Just followed your instructions, I already had redis.ini deleted and recomplied php and redis.so is still not getting installed.

    Upon running php --ini I get:

    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
     
  4. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:50 PM
    Nginx 1.13.x
    MariaDB 5.5
    To troubleshoot, you need to check the the php upgrade log 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 initial install log. You can see full details at How to troubleshoot Centmin Mod initial install issues

    Also post output for the following

    Code (Text):
    php -v
    php --ini
    php --ri 'Zend Opcache'
    ls -lah /usr/local/bin/php
    


    Code:
    ls -lah $(cat /usr/local/bin/php-config | awk '/^extension_dir/ {extdir=$1} END {gsub(/\047|extension_dir|=|)/,"",extdir); print extdir}')
    could also be issue right now with github.com dns Centmin Mod github.com repo 504 Timeouts | Centmin Mod Community which prevent redis github hosted code from being downloaded for compile.
     
  5. Rdurty2

    Rdurty2 Member

    38
    9
    8
    Oct 31, 2015
    Ratings:
    +12
    Local Time:
    7:50 AM
    1.11.4
    10.0.27
    So I don't think it's the DDOS on github right now because I upgraded to PHP 7 numerous days ago.

    Link to php upgrade log, hopefully I did this right: https://gist.githubusercontent.com/...od_1.2.3-eva2000.08_211016-125817_php_upgrade

    Code:
    php -v
    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
    PHP 7.0.12 (cli) (built: Oct 21 2016 13:03:10) ( NTS )
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.12, Copyright (c) 1999-2016, by Zend Technologies
    Code:
    php --ini
    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
    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/a_customphp.ini,
    /etc/centminmod/php.d/curlcainfo.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/redis.ini,
    /etc/centminmod/php.d/zendopcache.ini,
    /etc/centminmod/php.d/zzzz_phpsessions.ini
    Code:
    php --ri 'Zend Opcache'
    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
    
    Zend OPcache
    
    Opcode Caching => Disabled
    Optimization => Disabled
    SHM Cache => Enabled
    File Cache => Disabled
    Startup Failed => Opcode Caching is disabled for CLI
    
    Directive => Local Value => Master Value
    opcache.enable => On => On
    opcache.use_cwd => On => On
    opcache.validate_timestamps => On => On
    opcache.inherited_hack => On => On
    opcache.dups_fix => Off => Off
    opcache.revalidate_path => Off => Off
    opcache.log_verbosity_level => 1 => 1
    opcache.memory_consumption => 256 => 256
    opcache.interned_strings_buffer => 8 => 8
    opcache.max_accelerated_files => 16000 => 16000
    opcache.max_wasted_percentage => 5 => 5
    opcache.consistency_checks => 0 => 0
    opcache.force_restart_timeout => 180 => 180
    opcache.revalidate_freq => 180 => 180
    opcache.file_update_protection => 2 => 2
    opcache.preferred_memory_model => no value => no value
    opcache.blacklist_filename => no value => no value
    opcache.max_file_size => 0 => 0
    opcache.protect_memory => 0 => 0
    opcache.save_comments => 1 => 1
    opcache.fast_shutdown => 1 => 1
    opcache.optimization_level => 0x7FFFBFFF => 0x7FFFBFFF
    opcache.enable_file_override => On => On
    opcache.enable_cli => Off => Off
    opcache.error_log => no value => no value
    opcache.restrict_api => no value => no value
    opcache.lockfile_path => /tmp => /tmp
    opcache.file_cache => no value => no value
    opcache.file_cache_only => 0 => 0
    opcache.file_cache_consistency_checks => 1 => 1
    opcache.huge_code_pages => Off => Off
    
    Code:
    ls -lah /usr/local/bin/php
    -rwxr-xr-x 1 root root 9.0M Oct 21 13:04 /usr/local/bin/php
    
    Code:
    ls -lah $(cat /usr/local/bin/php-config | awk '/^extension_dir/ {extdir=$1} END {gsub(/\047|extension_dir|=|)/,"",extdir); print extdir}')
    total 4.7M
    drwxr-xr-x 2 root root 4.0K Oct 21 13:04 .
    drwxr-xr-x 5 root root 4.0K Oct 17 18:23 ..
    -rwxr-xr-x 1 root root  78K Oct 17 18:26 geoip.so
    -rwxr-xr-x 1 root root 194K Oct 21 13:04 igbinary.so
    -rwxr-xr-x 1 root root 1.2M Oct 17 18:26 imagick.so
    -rwxr-xr-x 1 root root 349K Oct 17 18:26 memcached.so
    -rwxr-xr-x 1 root root 476K Oct 17 18:26 memcache.so
    -rwxr-xr-x 1 root root 1.7M Oct 21 13:04 opcache.a
    -rwxr-xr-x 1 root root 877K Oct 21 13:04 opcache.so
    
     
  6. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:50 PM
    Nginx 1.13.x
    MariaDB 5.5
  7. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:50 PM
    Nginx 1.13.x
    MariaDB 5.5
    ah it resolves now.. checked and just remembered why not working for you as 123.08stable redis php extension routine doesn't support php 7, so you have to disable redis php or switch to 123.09beta01 which supports redis php extension for php 7. Been so long forgot about those differences between 123.08stable and 123.09beta01 for php 7.

    To switch to Centmin Mod to 123.09beta01, see instructions in 1st post outlined here Beta Branch - Centmin Mod .09 beta branch Testing
     
  8. Rdurty2

    Rdurty2 Member

    38
    9
    8
    Oct 31, 2015
    Ratings:
    +12
    Local Time:
    7:50 AM
    1.11.4
    10.0.27
    looks like I'm switching to 123.09beta01!! I need my redis caching!!

    Thanks for all of your help and quick replies. Great support as always!!!!
     
    • Like Like x 1
  9. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:50 PM
    Nginx 1.13.x
    MariaDB 5.5
    oh beware github's dns/ddos attack issues may impact on switching branches via centmin.sh menu option 23 as it involves github.com hosted centmin mod repo code.