Welcome to Centmin Mod Community
Register Now

[Solved] Warning when running cli php command

Discussion in 'AlmaLinux 8 & Rocky Linux 8 Beta Testing' started by duderuud, Nov 29, 2022.

  1. duderuud

    duderuud Premium Member Premium Member

    202
    74
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +153
    Local Time:
    6:17 PM
    1.25 x
    10.6
    When running the Elasticsearch index command of Xenforo
    Code:
    php cmd.php xf-rebuild:search
    A PHP warning appears:
    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
    
    And indeed, memcache.so is nowhere to be found. memcached.so is. Maybe a symlink would fix it?

     
  2. wmtech

    wmtech Active Member

    165
    44
    28
    Jul 22, 2017
    Ratings:
    +125
    Local Time:
    6:17 PM
    You should generally disable the memcache extension. It is old and doesn't get updated. Maybe it should be removed from CMM completely.

    A quick solution for you is out marking the line starting with "extension=" in /etc/centminmod/php.d/memcache.ini

    Alternatively you could just delete this whole file.
     
  3. eva2000

    eva2000 Administrator Staff Member

    51,947
    11,973
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,470
    Local Time:
    2:17 AM
    Nginx 1.25.x
    MariaDB 10.x
    related to memcache PHP extension fix I updated for 124.00stable and 130.00beta01 today https://community.centminmod.com/th...on-routine-for-php-8-x-in-124-00stable.23494/

    You can run cmupdate, and centmin.sh menu option 5 to recompile PHP or as @wmtech stated disable memcache PHP extension as it's legacy old now as most PHP apps use memcached PHP extension now. To disable set in persistent config file /etc/centminmod/custom_config.inc before centmin.sh menu option 5 run
    Code (Text):
    PHP_MEMCACHE='n'
     
  4. duderuud

    duderuud Premium Member Premium Member

    202
    74
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +153
    Local Time:
    6:17 PM
    1.25 x
    10.6
  5. eva2000

    eva2000 Administrator Staff Member

    51,947
    11,973
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,470
    Local Time:
    2:17 AM
    Nginx 1.25.x
    MariaDB 10.x
    Excellent. Thanks for the update :)
     
  6. duderuud

    duderuud Premium Member Premium Member

    202
    74
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +153
    Local Time:
    6:17 PM
    1.25 x
    10.6
    FYI: The current 1.30 installer has some reference to memcache even though PHP_MEMCACHE='n' is present in custom_config:

    Code (Text):
    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
     
  7. eva2000

    eva2000 Administrator Staff Member

    51,947
    11,973
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,470
    Local Time:
    2:17 AM
    Nginx 1.25.x
    MariaDB 10.x
  8. duderuud

    duderuud Premium Member Premium Member

    202
    74
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +153
    Local Time:
    6:17 PM
    1.25 x
    10.6
    It's a fresh install, which log do you need?
     
  9. eva2000

    eva2000 Administrator Staff Member

    51,947
    11,973
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,470
    Local Time:
    2:17 AM
    Nginx 1.25.x
    MariaDB 10.x
  10. eva2000

    eva2000 Administrator Staff Member

    51,947
    11,973
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,470
    Local Time:
    2:17 AM
    Nginx 1.25.x
    MariaDB 10.x
  11. duderuud

    duderuud Premium Member Premium Member

    202
    74
    28
    Dec 5, 2020
    The Netherlands
    Ratings:
    +153
    Local Time:
    6:17 PM
    1.25 x
    10.6
    That AX102 server will be a production server but I'm not there yet.

    Will reinstall the whole server in the next few days to test it out and will let you know.

    Edit: Just reinstalled the server and all goes well. Thanks for the quick fix!
     
    Last edited: Oct 29, 2023