Welcome to Centmin Mod Community
Become a Member

PHP-FPM Swoole extension not installing during php 8.1 rebuild

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Nik, Mar 21, 2024.

  1. Nik

    Nik Member

    85
    5
    8
    Dec 7, 2015
    Ratings:
    +13
    Local Time:
    3:58 PM
    Unable to install php swoole on a fresh alma 8 + php 8.1 centmin server.


    Added it to custom config but php --ri swoole and php -r "print_r(get_loaded_extensions());" does not return it as installed.



    Please fill in any relevant information that applies to you:
    • CentOS Version: Alma 8
    • Centmin Mod Version Installed: 130.00beta01
    • Nginx Version Installed: 1.25.3
    • PHP Version Installed: 8.1.27
    • MariaDB MySQL Version Installed: 10.6
    • When was last time updated Centmin Mod code base ? : Just prior
    • 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
      CENTOS_ALPHATEST='y'
      NGINX_VERSION='1.25.0'
      NGINX_ONETWOTHREE_COMPAT='y'
      DEVTOOLSETTEN='n'
      DEVTOOLSETELEVEN='n'
      DEVTOOLSETTWELVE='y'
      SELFSIGNEDSSL_ECDSA='y'
      PHPFINFO='y'
      PYTHON_INSTALL_ALTERNATIVES='y'
      
      MARCH_TARGETNATIVE='n'
      
      DMOTD_PHPCHECK='y'
      NGINX_GEOIPTWOLITE='y'
      NGXDYNAMIC_GEOIPTWOLITE='y'
      NGINX_HPACK='y'
      NGINX_DYNAMICTLS='y'
      NGINX_PCRE_TWO='y'
      OPENSSL_VERSION='3.1.0'
      OPENSSL_VERSIONFALLBACK='3.1.0'
      OPENSSL_VERSION_OLDOVERRIDE='3.1.0'
      NGX_LDMOLD='y'
      PHP_LDMOLD='y'
      NGINX_NJS='y'
      NGXDYNAMIC_NJS='y'
      NGXDYNAMIC_BROTLI='y'
      NGINX_LIBBROTLI='y'
      NGINX_VIDEO='y'
      ENABLE_MARIADBTENFOURUPGRADE='y'
      ENABLE_MARIADBTENFIVEUPGRADE='y'
      ENABLE_MARIADBTENSIXUPGRADE='y'
      PHPSWOOLE='y'
      
      
      
    PHP UPGRADE LOG (pulled some relevant sections)
    Code (Text):
    LD_LIBRARY_PATH=/usr/local/lib64 PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:" ../configure --enable-fpm --enable-opcache --enable-intl --enable-pcntl --with-mcrypt --with-snmp --enable-embed=shared --with-mhash --with-zlib --with-gettext --enable-exif --with-zip --with-libzip --with-bz2 --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --with-pear --enable-mbstring --with-openssl --with-mysql=mysqlnd --with-libdir=lib64 --with-mysqli=mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock --with-curl --enable-gd --with-xmlrpc --enable-bcmath --enable-calendar  --enable-ftp --enable-gd-native-ttf --with-freetype --with-jpeg --with-png-dir=/usr --with-xpm --with-webp --with-t1lib=/usr --enable-shmop --with-pear --enable-mbstring --with-openssl --with-mysql=mysqlnd --with-libdir=lib64 --with-mysqli=mysqlnd --enable-pdo --with-pdo-sqlite --with-pdo-mysql=mysqlnd --enable-inline-optimization --with-imap --with-imap-ssl --with-kerberos --with-readline --with-libedit --with-gmp --with-pspell --with-tidy --with-enchant --with-fpm-user=nginx --with-fpm-group=nginx --with-ldap --with-ldap-sasl --with-password-argon2 --with-sodium=/usr/local --with-pic --with-config-file-scan-dir=/etc/centminmod/php.d --with-fpm-systemd --with-ffi --with-swoole --with-xsl
    configure: WARNING: unrecognized options: --with-mcrypt, --with-libzip, --with-mysql, --with-xmlrpc, --enable-gd-native-ttf, --with-png-dir, --with-t1lib, --with-mysql, --enable-inline-optimization, --with-swoole
    .....
    
    
    Thank you for using PHP.
    
    configure: WARNING: unrecognized options: --with-mcrypt, --with-libzip, --with-mysql, --with-xmlrpc, --enable-gd-native-ttf, --with-png-dir, --with-t1lib, --with-mysql, --enable-inline-optimization, --with-swoole
    
    ......
    
    
      --configure-options [--enable-fpm --enable-opcache --enable-intl --enable-pcntl --with-mcrypt --with-snmp --enable-embed=shared --with-mhash --with-zlib --with-gettext --enable-exif --with-zip --with-libzip --with-bz2 --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-mysql-sock=/var/lib/mysql/mysql.sock --with-curl --enable-gd --with-xmlrpc --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --with-freetype --with-jpeg --with-png-dir=/usr --with-xpm --with-webp --with-t1lib=/usr --enable-shmop --with-pear --enable-mbstring --with-openssl --with-mysql=mysqlnd --with-libdir=lib64 --with-mysqli=mysqlnd --enable-pdo --with-pdo-sqlite --with-pdo-mysql=mysqlnd --enable-inline-optimization --with-imap --with-imap-ssl --with-kerberos --with-readline --with-libedit --with-gmp --with-pspell --with-tidy --with-enchant --with-fpm-user=nginx --with-fpm-group=nginx --with-ldap --with-ldap-sasl --with-password-argon2 --with-sodium=/usr/local --with-pic --with-config-file-scan-dir=/etc/centminmod/php.d --with-fpm-systemd --with-ffi --with-swoole --with-xsl PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:
    PNG_CFLAGS=-I/usr/include PNG_LIBS=-L/usr/lib64 -lpng16 ICU_CFLAGS=-fPIC ICU_LIBS=-L/usr/lib64 -licuio -licui18n -licuuc -licudata ONIG_CFLAGS=-I/usr/include ONIG_LIBS=-L/usr/lib64 -lonig LIBSODIUM_CFLAGS=-fPIC LIBSODIUM_LIBS=-L/usr/local/lib64 -lsodium ARGON2_CFLAGS=-I/usr/local/include ARGON2_LIBS=-L/usr/local/lib64 -largon2 LIBZIP_CFLAGS=-fPIC LIBZIP_LIBS=-L/usr/local/lib64 -lzip]
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    52,646
    12,069
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,595
    Local Time:
    5:58 AM
    Nginx 1.25.x
    MariaDB 10.x
    Strange just tried and it's working for me

    Code (Text):
    php --ri swoole
    
    swoole
    
    Swoole => enabled
    Author => Swoole Team <team@swoole.com>
    Version => 5.1.0
    Built => Mar 22 2024 21:40:33
    coroutine => enabled with boost asm context
    epoll => enabled
    eventfd => enabled
    signalfd => enabled
    cpu_affinity => enabled
    spinlock => enabled
    rwlock => enabled
    sockets => enabled
    openssl => OpenSSL 1.1.1k  FIPS 25 Mar 2021
    dtls => enabled
    http2 => enabled
    json => enabled
    curl-native => enabled
    pcre => enabled
    zlib => 1.2.11
    mutex_timedlock => enabled
    pthread_barrier => enabled
    futex => enabled
    mysqlnd => enabled
    async_redis => enabled
    
    Directive => Local Value => Master Value
    swoole.enable_coroutine => On => On
    swoole.enable_library => On => On
    swoole.enable_fiber_mock => Off => Off
    swoole.enable_preemptive_scheduler => Off => Off
    swoole.display_errors => On => On
    swoole.use_shortname => On => On
    swoole.unixsock_buffer_size => 8388608 => 8388608
    

    Code (Text):
    php -r "print_r(get_loaded_extensions());"
    Array
    (
        [0] => Core
        [1] => date
        [2] => libxml
        [3] => openssl
        [4] => pcre
        [5] => sqlite3
        [6] => zlib
        [7] => bcmath
        [8] => bz2
        [9] => calendar
        [10] => ctype
        [11] => curl
        [12] => dom
        [13] => enchant
        [14] => hash
        [15] => FFI
        [16] => fileinfo
        [17] => filter
        [18] => ftp
        [19] => gd
        [20] => gettext
        [21] => gmp
        [22] => json
        [23] => iconv
        [24] => SPL
        [25] => intl
        [26] => session
        [27] => ldap
        [28] => mbstring
        [29] => standard
        [30] => mysqlnd
        [31] => pcntl
        [32] => exif
        [33] => mysqli
        [34] => PDO
        [35] => pdo_mysql
        [36] => pdo_sqlite
        [37] => Phar
        [38] => posix
        [39] => pspell
        [40] => readline
        [41] => Reflection
        [42] => imap
        [43] => shmop
        [44] => SimpleXML
        [45] => snmp
        [46] => soap
        [47] => sockets
        [48] => sodium
        [49] => sysvmsg
        [50] => sysvsem
        [51] => sysvshm
        [52] => tidy
        [53] => tokenizer
        [54] => xml
        [55] => xmlreader
        [56] => xmlwriter
        [57] => xsl
        [58] => zip
        [59] => brotli
        [60] => geoip
        [61] => igbinary
        [62] => imagick
        [63] => lz4
        [64] => lzf
        [65] => mailparse
        [66] => maxminddb
        [67] => mcrypt
        [68] => memcache
        [69] => memcached
        [70] => redis
        [71] => swoole
        [72] => timezonedb
        [73] => zstd
        [74] => Zend OPcache
    )

    Code (Text):
    php-config
    Usage: /usr/local/bin/php-config [OPTION]
    Options:
      --prefix            [/usr/local]
      --includes          [-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]
      --ldflags           [ -Wl,-z,relro,-z,now -pie -L/usr/local/lib64]
      --libs              [-lcrypt  -lc-client  -ltidy -lresolv -lncurses -laspell -lpspell -lrt -lldap -llber -lstdc++ -lcrypt -lpam -lgmp -lbz2 -lutil -lrt -lm -ldl  -lsystemd -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lsqlite3 -lz -lcurl -lxml2 -lenchant -lgmodule-2.0 -lglib-2.0 -lffi -lssl -lcrypto -lz -lpng16 -lwebp -ljpeg -lXpm -lX11 -lfreetype -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -licuio -licui18n -licuuc -licudata -lonig -lsqlite3 -ledit -lxml2 -lnetsnmp -lm -lssl -lssl -lcrypto -lxml2 -lsodium -largon2 -lxml2 -lxml2 -lxml2 -lxslt -lm -lxml2 -lexslt -lxslt -lm -lgcrypt -ldl -lgpg-error -lxml2 -lzip -lz -lssl -lcrypto -lcrypt ]
      --extension-dir     [/usr/local/lib/php/extensions/no-debug-non-zts-20210902]
      --include-dir       [/usr/local/include/php]
      --man-dir           [/usr/local/php/man]
      --php-binary        [/usr/local/bin/php]
      --php-sapis         [ cli embed fpm phpdbg cgi]
      --ini-path          [/usr/local/lib]
      --ini-dir           [/etc/centminmod/php.d]
      --configure-options [--enable-fpm --enable-opcache --enable-intl --enable-pcntl --with-mcrypt --with-snmp --enable-embed=shared --with-mhash --with-zlib --with-gettext --enable-exif --with-zip --with-libzip --with-bz2 --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-mysql-sock=/var/lib/mysql/mysql.sock --with-curl --enable-gd --with-xmlrpc --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --with-freetype --with-jpeg --with-png-dir=/usr --with-xpm --with-webp --with-t1lib=/usr --enable-shmop --with-pear --enable-mbstring --with-openssl --with-mysql=mysqlnd --with-libdir=lib64 --with-mysqli=mysqlnd --enable-pdo --with-pdo-sqlite --with-pdo-mysql=mysqlnd --enable-inline-optimization --with-imap --with-imap-ssl --with-kerberos --with-readline --with-libedit --with-gmp --with-pspell --with-tidy --with-enchant --with-fpm-user=nginx --with-fpm-group=nginx --with-ldap --with-ldap-sasl --with-password-argon2 --with-sodium=/usr/local --with-pic --with-config-file-scan-dir=/etc/centminmod/php.d --with-fpm-systemd --with-ffi --with-swoole --with-xsl PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig: PNG_CFLAGS=-I/usr/include PNG_LIBS=-L/usr/lib64 -lpng16 ICU_CFLAGS=-fPIC ICU_LIBS=-L/usr/lib64 -licuio -licui18n -licuuc -licudata ONIG_CFLAGS=-I/usr/include ONIG_LIBS=-L/usr/lib64 -lonig LIBSODIUM_CFLAGS=-fPIC LIBSODIUM_LIBS=-L/usr/local/lib64 -lsodium ARGON2_CFLAGS=-I/usr/local/include ARGON2_LIBS=-L/usr/local/lib64 -largon2 LIBZIP_CFLAGS=-fPIC LIBZIP_LIBS=-L/usr/local/lib64 -lzip]
      --version           [8.1.27]
      --vernum            [80127]
    

    Have you tried with these 2 disabled
    Code (Text):
    NGX_LDMOLD='y'
    PHP_LDMOLD='y'
    
     
  3. Nik

    Nik Member

    85
    5
    8
    Dec 7, 2015
    Ratings:
    +13
    Local Time:
    3:58 PM
    I should add I have another centmin install on centos 7.9 with php 8.0 which also doesn't work (except I get the PHP Startup: Unable to load dynamic library 'swoole.so' error now) but that's a separate issue.

    Anyway, this one was a fresh Alma 8 install (from a few months back). I commented out those two lines and no joy unfortunately, still no sign of the extension.
     
    Last edited: Mar 23, 2024
  4. eva2000

    eva2000 Administrator Staff Member

    52,646
    12,069
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,595
    Local Time:
    5:58 AM
    Nginx 1.25.x
    MariaDB 10.x
  5. Nik

    Nik Member

    85
    5
    8
    Dec 7, 2015
    Ratings:
    +13
    Local Time:
    3:58 PM
  6. eva2000

    eva2000 Administrator Staff Member

    52,646
    12,069
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,595
    Local Time:
    5:58 AM
    Nginx 1.25.x
    MariaDB 10.x
    Nothing in your provided PHP upgrade log shows up as problematic though --with-swoole not supported suggests that PHP Swoole extension wasn't compiled. I think it's because you recompiled same PHP major branch version on centmin.sh menu option 5. If your pre-existing PHP version is 8.1 branch and you ran centmin.sh menu option 5 and set PHP 8.1.27 as recompile version, the Centmin Mod will skip the PHP extension compiling routines to save time as using same PHP branch 8.1 doesn't really require PHP extensions to be recompiled. You can force recompile by setting in persistent config file /etc/centminmod/custom_config.inc the variable below
    Code (Text):
    AUTODETECPHP_OVERRIDE='y'

    or if you recompile to a different PHP branch i.e. PHP 8.0 or 8.2 that would also trigger PHP extension routines.

    I guess I'd need to figure out how to check for new PHP extensions enabled for existing PHP major branch versions to also trigger PHP extension routines.
     
  7. eva2000

    eva2000 Administrator Staff Member

    52,646
    12,069
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,595
    Local Time:
    5:58 AM
    Nginx 1.25.x
    MariaDB 10.x
    updated 130.00beta01 with fix so run cmupdate and try centmin.sh menu option 5 again :)
     
  8. Nik

    Nik Member

    85
    5
    8
    Dec 7, 2015
    Ratings:
    +13
    Local Time:
    3:58 PM
    Thanks. I did both cmupdate and put the
    AUTODETECPHP_OVERRIDE='y' and swoole is now getting bundled in. Thanks for the swift help.