apnscp version
revision: 6c7081da81c9aedc2c07c67f7983ca7454b12630
timestamp: 1793634548
ver_maj: 3
ver_min: 2
ver_patch: 49
ver_pre: ''
dirty: false
checksum: 13528ef6042d85d
debug: false
os: '10.2'
variant: rocky
kernel: 6.12.0-211.69.1.el10_2.x86_64
OS
Rocky Linux release 10.2 (Red Quartz)
System PHP 8.4.27, native multiPHP 8.1, 8.2, 8.3, 8.5. cp.bootstrapper pecl_extensions is [imagick,redis].
Reproducible?
Yes, every time.
cpcmd scope:set cp.bootstrapper pecl_extensions '[imagick,redis]'
upcp -sbf php/install-extensions
upcp -sbf php/multiphp
The redis build for 8.1 fails:
/usr/include/php/Zend/zend_operators.h:221:29: error: implicit declaration of function 'memrchr'; did you mean 'memchr'? [-Wimplicit-function-declaration]
make: *** [Makefile:224: redis_array_impl.lo] Error 1
phpize comes from native/8.1, but configure gets the system php-config:
PHP Api Version: 20210902
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main ...
checking for PHP extension directory... /usr/lib64/20240924
The 8.1 php-config itself is fine:
--prefix: /
--include-dir: //.socket/php/multiphp/native/8.1/include/php
--extension-dir: /usr/lib64/20210902
Running installPecl.sh by hand with PHPIZE and PHPCONFIG both pointed at native/8.1 builds redis fine.
Debug mode
Not applicable. It fails inside the bootstrapper, not apnscpd.
Cause
roles/apnscp/install-extensions/defaults/main.yml sets phpconfig: /usr/bin/php-config. That role is listed statically in bootstrap.yml and private role vars are off, so the default leaks into later roles.
roles/php/multiphp/tasks/build-multi.yml and roles/php/build-from-source/tasks/multiphp.yml include php/install-pecl-module with only multiphp_build: true. phpize falls back to the role default (native prefix, correct). phpconfig picks up the leaked /usr/bin/php-config. The include_vars in roles/php/install-extensions/tasks/main.yml that’s supposed to re-evaluate phpconfig is skipped because phpconfig is already set.
GCC 14 on Rocky 10 makes the implicit declaration a hard error. On EL8/9 it’s only a warning, so it has probably been building native modules against the system headers and installing them into the system extension dir there.
Proposed fix
Pass both explicitly in the two multiPHP pecl includes, the same way apnscp/install-extensions already does for the panel build:
phpize: "{{ multiphp_php_prefix }}/bin/phpize"
phpconfig: "{{ multiphp_php_prefix }}/bin/php-config"
Or move phpconfig in apnscp/install-extensions out of defaults/ and into the include vars so it stops leaking.