Want to subscribe to topics you're interested in?
Become a Member

Install Fresh install and getting 'unable to load dynamic library memcache.so'

Discussion in 'Bug Reports' started by fly, Oct 28, 2022.

  1. fly

    fly Member

    109
    16
    18
    Jul 27, 2019
    Ratings:
    +28
    Local Time:
    5:29 AM
    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 124.00stable
    • Nginx Version Installed: current
    • PHP Version Installed: 8.1
    • MariaDB MySQL Version Installed: current
    • When was last time updated Centmin Mod code base ? : Today
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      cat /etc/centminmod/custom_config.inc
      

      Post output in CODE tags.
    Code:
    LETSENCRYPT_DETECT='y'
    MARCH_TARGETNATIVE='n'
    
    This is a fresh install from yesterday. Ran cmupdate today. Also tried option 10, but didn't see any obvious errors. Full error when adding a WP vhost:


    Code:
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20210902/memcache.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/memcache.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/memcache.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902//usr/local/lib/php/extensions/no-debug-non-zts-20210902/memcache.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902//usr/local/lib/php/extensions/no-debug-non-zts-20210902/memcache.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    8:29 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Every centmin.sh menu option run has automatic logging to /root/centminlogs so you can see the run saved for centmin.sh menu option 10 run by inspecting that log

    Below command will list the logs in date ascending order (latest logs at bottom) filtered via grep for memcache and using tail to list the last 2 entries
    Code (Text):
    ls -lAhrt /root/centminlogs | grep memcache | tail -2
    

    i.e.
    Code (Text):
    ls -lAhrt /root/centminlogs | grep memcache | tail -2
    -rw-r--r--  1 root root  132K Jun  9 22:35 centminmod_130.00beta01.b67_090622-223433_memcached_reinstall.log
    -rw-rw-r--  1 root root  131K Oct 28 14:42 centminmod_130.00beta01.b230_281022-144211_memcached_reinstall.log
    

    So /root/centminlogs/centminmod_130.00beta01.b230_281022-144211_memcached_reinstall.log is the log for the last centmin.sh menu option 10 run. You can sanitize the log for sensitive info i.e. server hostname/IP etc and then either share that log publicly via gist.github.com, pastebin etc or private message me privately.

    It could be PHP 8.1 related as memcache (with d at end) is way older PHP extension not updated much compared to memcached that has more updates for newer PHP versions. TBH, memcache PHP extension probably should be retired as no one really uses it I think these days.

    If you don't use older legacy memcache PHP extension compared to memcached PHP extension, you can set in persistent config file /etc/centminmod/custom_config.inc the variable
    Code (Text):
    PHP_MEMCACHE='n'

    To disable it at centmin.sh menu option 5 and 10 run stages.

    Or maybe I should set PHP_MEMCACHE='n' automatically if folks select PHP 8.1+ ?

    However, I just tested PHP 8.1.12 and memcached and memcache PHP extensions work
    Code (Text):
    php -v
    PHP 8.1.12 (cli) (built: Oct 28 2022 14:51:23) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.12, Copyright (c) Zend Technologies
        with Zend OPcache v8.1.12, Copyright (c), by Zend Technologies
    

    memcache PHP extension
    Code (Text):
    php --ri memcache
    
    memcache
    
    memcache support => enabled
    Version => 8.1-dev
    
    Directive => Local Value => Master Value
    memcache.allow_failover => 1 => 1
    memcache.max_failover_attempts => 20 => 20
    memcache.default_port => 11211 => 11211
    memcache.chunk_size => 32768 => 32768
    memcache.protocol => ascii => ascii
    memcache.hash_strategy => consistent => consistent
    memcache.hash_function => crc32 => crc32
    memcache.redundancy => 1 => 1
    memcache.session_redundancy => 2 => 2
    memcache.compress_threshold => 20000 => 20000
    memcache.lock_timeout => 15 => 15
    memcache.session_prefix_host_key => Off => Off
    memcache.session_prefix_host_key_remove_www => On => On
    memcache.session_prefix_host_key_remove_subdomain => Off => Off
    memcache.session_prefix_static_key => no value => no value
    memcache.session_save_path => no value => no value
    memcache.prefix_host_key => Off => Off
    memcache.prefix_host_key_remove_www => On => On
    memcache.prefix_host_key_remove_subdomain => Off => Off
    

    memcached PHP extension
    Code (Text):
    php --ri memcached
    
    memcached
    
    memcached support => enabled
    Version => 3.2.1-dev
    libmemcached version => 1.0.16
    SASL support => yes
    Session support => yes
    igbinary support => no
    json support => yes
    msgpack support => no
    
    Directive => Local Value => Master Value
    memcached.sess_locking => On => On
    memcached.sess_lock_wait_min => 150 => 150
    memcached.sess_lock_wait_max => 150 => 150
    memcached.sess_lock_retries => 5 => 5
    memcached.sess_lock_expire => 0 => 0
    memcached.sess_binary_protocol => Off => Off
    memcached.sess_consistent_hash => Off => Off
    memcached.sess_consistent_hash_type => ketama => ketama
    memcached.sess_number_of_replicas => 0 => 0
    memcached.sess_randomize_replica_read => Off => Off
    memcached.sess_remove_failed_servers => Off => Off
    memcached.sess_server_failure_limit => 0 => 0
    memcached.sess_connect_timeout => 3000 => 3000
    memcached.sess_sasl_username => no value => no value
    memcached.sess_sasl_password => no value => no value
    memcached.sess_persistent => Off => Off
    memcached.sess_prefix => memc.sess.key. => memc.sess.key.
    memcached.sess_lock_wait => not set => not set
    memcached.sess_lock_max_wait => not set => not set
    memcached.compression_type => fastlz => fastlz
    memcached.compression_factor => 1.3 => 1.3
    memcached.compression_threshold => 2000 => 2000
    memcached.serializer => php => php
    memcached.store_retry_count => 0 => 0
    memcached.default_consistent_hash => Off => Off
    memcached.default_binary_protocol => Off => Off
    memcached.default_connect_timeout => 0 => 0
    

    all loaded PHP extensions
    Code (Text):
    php -m
    [PHP Modules]
    bcmath
    brotli
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    enchant
    event
    exif
    FFI
    fileinfo
    filter
    ftp
    gd
    geoip
    gettext
    gmp
    hash
    iconv
    igbinary
    imagick
    imap
    intl
    json
    ldap
    libxml
    mailparse
    maxminddb
    mbstring
    mcrypt
    memcache
    memcached
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    pspell
    readline
    redis
    Reflection
    session
    shmop
    SimpleXML
    snmp
    soap
    sockets
    sodium
    SPL
    sqlite3
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    timezonedb
    tokenizer
    xml
    xmlreader
    xmlwriter
    Zend OPcache
    zip
    zlib
    
    [Zend Modules]
    Zend OPcache
    
     
    Last edited: Oct 29, 2022
  3. fly

    fly Member

    109
    16
    18
    Jul 27, 2019
    Ratings:
    +28
    Local Time:
    5:29 AM
    I PM'd you the full Pastebin, but I'm assuming this is the issue.

    Code:
     ccache gcc -I. -I/svr-setup/memcache-3.0.8 -I/svr-setup/memcache-3.0.8/include -I/svr-setup/memcache-3.0.8/main -I/svr-setup/memcache-3.0.8 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O3 -m64 -march=x86-64 -mavx -mavx2 -mpclmul -msse4 -msse4.1 -msse4.2 -Wimplicit-fallthrough=0 -fcode-hoisting -Wno-cast-function-type -Wno-cast-align -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-deprecated-declarations -Wno-int-conversion -Wno-unused-result -Wno-unused-result -pipe -I/usr/local/include/php -DZEND_COMPILE_DL_EXT=1 -c /svr-setup/memcache-3.0.8/memcache_queue.c -MMD -MF memcache_queue.dep -MT memcache_queue.lo  -fPIC -DPIC -o .libs/memcache_queue.o
    /svr-setup/memcache-3.0.8/memcache_pool.c:38:10: fatal error: ext/standard/php_smart_str.h: No such file or directory
       38 | #include "ext/standard/php_smart_str.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make: *** [memcache_pool.lo] Error 1
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    8:29 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    It's because Centmin Mod routine is for some reason detecting PHP 7.x and not 8.x for the system so installing memcache PHP extension for PHP 7.x and not PHP 8.x compatible version.

    It seems Centmin Mod 124.00stable's routines are missing some PHP 8.1 detections/support and bug fixes which were later added to Centmin Mod 130.00beta01 only as all the latest updates go into 130.00beta01 first. According to git blame it was added to 130.00beta01 ~2 months ago update memcached server 1.6.17 & routines in 130.00beta01 ยท centminmod/centminmod@52ff16b

    So will need backporting to 124.00stable evetually
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    8:29 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  6. fly

    fly Member

    109
    16
    18
    Jul 27, 2019
    Ratings:
    +28
    Local Time:
    5:29 AM
    You are a wizard as always.

    Just for my own knowledge, should 130 be relatively stable for CentOS 7, kinda like the beta (123?) was for 124stable?
     
  7. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    8:29 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yes generally 130.00beta01 would follow 123.09beta01 in relatively stable for CentOS 7. But this time 130.00beta01 also adds code hidden behind flags for EL8/EL9 development for AlmaLinux 8/9 and Rocky Linux 8/9 support too this time. So there is possibility of some instability if some of the EL8/EL9 code leaks into a EL7/CentOS 7 system. But so far hasn't. Currently, a group of Centmin Mod users are testing 130.00beta01 for EL8 at least for AlmaLinux 8/Rocky Linux 8 support https://community.centminmod.com/threads/centmin-mod-centos-8-compatibility-worklog.18372/ :)