[feat] Add gnu based static binary support#592
Conversation
|
@dunglas Building some extension combinations with glibc is pretty smooth at the moment, but I'm not sure there are any hidden issues I haven't discovered yet. Docs are also in this PR. It would be great if you'd like to provide some suggestions or feedback, and I'll merge to the main branch later. |
|
Thank you for this!! I had a (very) quick look and the patch looks good to me. I'll try to build FrankenPHP with it to see if it works, but as I'll be in vacation for 10 days, it may take some time. |
|
Hey 👋🏻 As you can see, it still fails with: I'm available for any help if needed, of course. |
|
@ptondereau You should use Build glibc Compatible Linux BinaryThe latest version of static-php-cli includes the First, clone the repository of this project and add the following content to the ; Modify this file name to `env.custom.ini`, and run `bin/spc-gnu-docker`,
; you can compile a GNU libc based static binary !
[global]
SPC_SKIP_DOCTOR_CHECK_ITEMS="if musl-wrapper is installed,if musl-cross-make is installed"
[linux]
CC=gcc
CXX=g++
AR=ar
LD=ld
SPC_DEFAULT_C_FLAGS=-fPIC
SPC_NO_MUSL_PATH=yes
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-Wl,-O1 -pie"
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm -lresolv -lutil"Then, run the following command once. bin/spc-gnu-dockerAfter the image is built, you will see the same command help menu as After the container is ready, you can refer to the local build section to build your PHP static binary. Unlike the default build, when building in the glibc environment, you must add the parameter bin/spc-gnu-docker --libc=glibc build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debugNotesIn rare cases, glibc-based static PHP may encounter segment faults and other errors, but there are currently few examples. glibc build is an extended feature and is not part of the default static-php support. If you need to build glibc-based binaries without using Docker, Since glibc binaries are not the main goal of the project, |
# Conflicts: # src/SPC/builder/linux/LinuxBuilder.php
|
@dunglas @ptondereau Voilà! I had some time over the weekend to do some small experiments, making a series of changes to spc and building the first glibc-based frankenphp. I forked frankenphp, made some changes to build-static.sh, and created a Docker script in this branch for temporary testing of one-click building frankenphp, just need to run one command: You can check this file in the current branch and the modified content of frankenphp's fork, maybe it will help frankenphp. This also solve some embed warnings and library compatibility. |
|
That's awesome. Don't hesitate to open a PR on FrankenPHP, we'll definitely add a glibc-based static build. I can also finish the FrankenPHP patch if you want. Thanks again |
There was a problem hiding this comment.
PR Overview
This PR adds documentation support for building GNU libc (glibc) based static binaries along with updates to the sidebar navigation and environment variable configuration guides in both English and Chinese. Key changes include:
- New build guides for glibc compatible Linux binaries in English and Chinese.
- Updates to sidebar entries to integrate the new build guide links.
- Enhancements to the environment variables documentation to introduce the use of an override file (config/env.custom.ini).
Reviewed Changes
| File | Description |
|---|---|
| docs/en/guide/build-with-glibc.md | New guide covering the process of building glibc compatible static binaries. |
| docs/.vitepress/sidebar.en.ts | Updated sidebar entries to include basic and extended build guide sections. |
| docs/en/guide/env-vars.md | Added instructions on using the config/env.custom.ini file for complex build settings. |
| docs/zh/guide/build-with-glibc.md | Chinese version of the glibc build guide. |
| docs/zh/guide/env-vars.md | Chinese update discussing the use of config/env.custom.ini for changing environment vars. |
| docs/.vitepress/sidebar.zh.ts | Updated Chinese sidebar entries to reflect the new navigation structure for guides. |
| docs/en/guide/index.md | Modified link texts in the guide index for clarity. |
| docs/en/guide/troubleshooting.md | Minor addition in troubleshooting guide regarding multiple builds. |
| docs/zh/guide/troubleshooting.md | Chinese troubleshooting guide updated with multiple build reference. |
Copilot reviewed 63 out of 63 changed files in this pull request and generated no comments.
|
@crazywhalecc you accidentally changed the github url of static-php-cli in the script to crazywhale/static-php-cli instead of crazywhalecc/static-php-cli. I don't think that's you :P |
|
@DubbleClick Where did I missing? |
|
Sorry to revive this again, but shouldn't the resulting php binary be able to load extensions like xdebug dynamically, on top of the static extensions already statically compiled into it? SPC_NO_MUSL_PATH=yes
; compiler environments
CC=gcc
CXX=g++
AR=ar
LD=ld.gold
SPC_DEFAULT_C_FLAGS=-fPIE
EXTENSION_DIR=/usr/lib64/php/modules
SPC_CMD_PREFIX_PHP_CONFIGURE="${SPC_PHP_DEFAULT_LD_LIBRARY_PATH_CMD} ./configure --prefix= --with-valgrind=no --enable-shared=yes --enable-static=yes --disable-all --disable-cgi --disable-phpdbg --with-pic"
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm"
; EXTRA_LDFLAGS_PROGRAM for `make` php
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-all-static -Wl,-O1 -pie"Compiling with [root@svmdev static-php-cli]# buildroot/bin/php -v
PHP Warning: Failed loading Zend extension 'opcache' (tried: /usr/lib64/php/modules/opcache (/usr/lib64/php/modules/opcache: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/opcache.so (/usr/lib64/php/modules/opcache.so: undefined symbol: zend_ini_boolean_displayer_cb)) in Unknown on line 0
PHP Warning: Failed loading Zend extension 'xdebug.so' (tried: /usr/lib64/php/modules/xdebug.so (/usr/lib64/php/modules/xdebug.so: undefined symbol: OnUpdateString), /usr/lib64/php/modules/xdebug.so.so (/usr/lib64/php/modules/xdebug.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'bz2' (tried: /usr/lib64/php/modules/bz2 (/usr/lib64/php/modules/bz2: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/bz2.so (/usr/lib64/php/modules/bz2.so: undefined symbol: zif_fwrite)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'calendar' (tried: /usr/lib64/php/modules/calendar (/usr/lib64/php/modules/calendar: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/calendar.so (/usr/lib64/php/modules/calendar.so: undefined symbol: add_assoc_zval_ex)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'ctype' (tried: /usr/lib64/php/modules/ctype (/usr/lib64/php/modules/ctype: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/ctype.so (/usr/lib64/php/modules/ctype.so: undefined symbol: zend_zval_type_name)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: /usr/lib64/php/modules/curl (/usr/lib64/php/modules/curl: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/curl.so (/usr/lib64/php/modules/curl.so: undefined symbol: zend_known_strings)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'dom' (tried: /usr/lib64/php/modules/dom (/usr/lib64/php/modules/dom: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/dom.so (/usr/lib64/php/modules/dom.so: undefined symbol: zend_empty_array)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'exif' (tried: /usr/lib64/php/modules/exif (/usr/lib64/php/modules/exif: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/exif.so (/usr/lib64/php/modules/exif.so: undefined symbol: php_stream_stdio_ops)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'fileinfo' (tried: /usr/lib64/php/modules/fileinfo (/usr/lib64/php/modules/fileinfo: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/fileinfo.so (/usr/lib64/php/modules/fileinfo.so: undefined symbol: file_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'ftp' (tried: /usr/lib64/php/modules/ftp (/usr/lib64/php/modules/ftp: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/ftp.so (/usr/lib64/php/modules/ftp.so: undefined symbol: zend_string_init_interned)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'gd' (tried: /usr/lib64/php/modules/gd (/usr/lib64/php/modules/gd: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/gd.so (/usr/lib64/php/modules/gd.so: undefined symbol: zend_ini_boolean_displayer_cb)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'gettext' (tried: /usr/lib64/php/modules/gettext (/usr/lib64/php/modules/gettext: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/gettext.so (/usr/lib64/php/modules/gettext.so: undefined symbol: php_info_print_table_row)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'iconv' (tried: /usr/lib64/php/modules/iconv (/usr/lib64/php/modules/iconv: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/iconv.so (/usr/lib64/php/modules/iconv.so: undefined symbol: zend_known_strings)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/lib64/php/modules/intl (/usr/lib64/php/modules/intl: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/intl.so (/usr/lib64/php/modules/intl.so: undefined symbol: OnUpdateStringUnempty)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'ldap' (tried: /usr/lib64/php/modules/ldap (/usr/lib64/php/modules/ldap: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/ldap.so (/usr/lib64/php/modules/ldap.so: undefined symbol: OnUpdateLong)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: /usr/lib64/php/modules/mbstring (/usr/lib64/php/modules/mbstring: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mbstring.so (/usr/lib64/php/modules/mbstring.so: undefined symbol: zend_ini_boolean_displayer_cb)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /usr/lib64/php/modules/mysqlnd (/usr/lib64/php/modules/mysqlnd: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mysqlnd.so (/usr/lib64/php/modules/mysqlnd.so: undefined symbol: OnUpdateBool)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo' (tried: /usr/lib64/php/modules/pdo (/usr/lib64/php/modules/pdo: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pdo.so (/usr/lib64/php/modules/pdo.so: undefined symbol: zend_ce_exception)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'phar' (tried: /usr/lib64/php/modules/phar (/usr/lib64/php/modules/phar: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/phar.so (/usr/lib64/php/modules/phar.so: undefined symbol: zend_ini_boolean_displayer_cb)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'posix' (tried: /usr/lib64/php/modules/posix (/usr/lib64/php/modules/posix: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/posix.so (/usr/lib64/php/modules/posix.so: undefined symbol: _php_stream_cast)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'shmop' (tried: /usr/lib64/php/modules/shmop (/usr/lib64/php/modules/shmop: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/shmop.so (/usr/lib64/php/modules/shmop.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'simplexml' (tried: /usr/lib64/php/modules/simplexml (/usr/lib64/php/modules/simplexml: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/simplexml.so (/usr/lib64/php/modules/simplexml.so: undefined symbol: zend_empty_array)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sodium' (tried: /usr/lib64/php/modules/sodium (/usr/lib64/php/modules/sodium: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/sodium.so (/usr/lib64/php/modules/sodium.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlite3' (tried: /usr/lib64/php/modules/sqlite3 (/usr/lib64/php/modules/sqlite3: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/sqlite3.so (/usr/lib64/php/modules/sqlite3.so: undefined symbol: OnUpdateString)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sysvmsg' (tried: /usr/lib64/php/modules/sysvmsg (/usr/lib64/php/modules/sysvmsg: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/sysvmsg.so (/usr/lib64/php/modules/sysvmsg.so: undefined symbol: zend_objects_not_comparable)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sysvsem' (tried: /usr/lib64/php/modules/sysvsem (/usr/lib64/php/modules/sysvsem: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/sysvsem.so (/usr/lib64/php/modules/sysvsem.so: undefined symbol: zend_objects_not_comparable)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sysvshm' (tried: /usr/lib64/php/modules/sysvshm (/usr/lib64/php/modules/sysvshm: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/sysvshm.so (/usr/lib64/php/modules/sysvshm.so: undefined symbol: zend_objects_not_comparable)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'tokenizer' (tried: /usr/lib64/php/modules/tokenizer (/usr/lib64/php/modules/tokenizer: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/tokenizer.so (/usr/lib64/php/modules/tokenizer.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xml' (tried: /usr/lib64/php/modules/xml (/usr/lib64/php/modules/xml: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/xml.so (/usr/lib64/php/modules/xml.so: undefined symbol: zend_string_init_interned)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xmlwriter' (tried: /usr/lib64/php/modules/xmlwriter (/usr/lib64/php/modules/xmlwriter: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/xmlwriter.so (/usr/lib64/php/modules/xmlwriter.so: undefined symbol: zend_string_init_interned)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xsl' (tried: /usr/lib64/php/modules/xsl (/usr/lib64/php/modules/xsl: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/xsl.so (/usr/lib64/php/modules/xsl.so: undefined symbol: zend_string_init_interned)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib64/php/modules/mysqli (/usr/lib64/php/modules/mysqli: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mysqli.so (/usr/lib64/php/modules/mysqli.so: undefined symbol: OnUpdateLong)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib64/php/modules/pdo_mysql (/usr/lib64/php/modules/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pdo_mysql.so (/usr/lib64/php/modules/pdo_mysql.so: undefined symbol: OnUpdateStringUnempty)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib64/php/modules/pdo_sqlite (/usr/lib64/php/modules/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pdo_sqlite.so (/usr/lib64/php/modules/pdo_sqlite.so: undefined symbol: zend_known_strings)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xmlreader' (tried: /usr/lib64/php/modules/xmlreader (/usr/lib64/php/modules/xmlreader: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/xmlreader.so (/usr/lib64/php/modules/xmlreader.so: undefined symbol: zend_string_init_interned)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/lib64/php/modules/zip.so (/usr/lib64/php/modules/zip.so: undefined symbol: compiler_globals), /usr/lib64/php/modules/zip.so.so (/usr/lib64/php/modules/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'apcu.so' (tried: /usr/lib64/php/modules/apcu.so (/usr/lib64/php/modules/apcu.so: undefined symbol: OnUpdateBool), /usr/lib64/php/modules/apcu.so.so (/usr/lib64/php/modules/apcu.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.4.4 (cli) (built: Mar 11 2025 12:17:20) (ZTS)
Copyright (c) The PHP Group
Zend Engine v4.4.4, Copyright (c) Zend Technologies
with Zend OPcache v8.4.4, Copyright (c), by Zend TechnologiesChanging --enable-static to --disable-static and without -all-static but get the same problems when trying to load dynamic libraries. |
|
Edit: without -all-static I actually get a slightly different error log! [root@svmdev static-php-cli]# buildroot/bin/php -v
PHP Warning: Failed loading Zend extension 'opcache' (tried: /usr/lib64/php/modules/opcache (/usr/lib64/php/modules/opcache: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/opcache.so (/usr/lib64/php/modules/opcache.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: Failed loading Zend extension 'xdebug.so' (tried: /usr/lib64/php/modules/xdebug.so (/usr/lib64/php/modules/xdebug.so: undefined symbol: compiler_globals), /usr/lib64/php/modules/xdebug.so.so (/usr/lib64/php/modules/xdebug.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: bz2: Unable to initialize module
Module compiled with build ID=API20240924,NTS
PHP compiled with build ID=API20240924,TS
These options need to match
in Unknown on line 0
PHP Warning: Module "calendar" is already loaded in Unknown on line 0
PHP Warning: Module "ctype" is already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: /usr/lib64/php/modules/curl (/usr/lib64/php/modules/curl: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/curl.so (/usr/lib64/php/modules/curl.so: undefined symbol: core_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'dom' (tried: /usr/lib64/php/modules/dom (/usr/lib64/php/modules/dom: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/dom.so (/usr/lib64/php/modules/dom.so: undefined symbol: executor_globals)) in Unknown on line 0
PHP Warning: Module "exif" is already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'fileinfo' (tried: /usr/lib64/php/modules/fileinfo (/usr/lib64/php/modules/fileinfo: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/fileinfo.so (/usr/lib64/php/modules/fileinfo.so: undefined symbol: file_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'ftp' (tried: /usr/lib64/php/modules/ftp (/usr/lib64/php/modules/ftp: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/ftp.so (/usr/lib64/php/modules/ftp.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: Module "gd" is already loaded in Unknown on line 0
PHP Warning: PHP Startup: gettext: Unable to initialize module
Module compiled with build ID=API20240924,NTS
PHP compiled with build ID=API20240924,TS
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'iconv' (tried: /usr/lib64/php/modules/iconv (/usr/lib64/php/modules/iconv: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/iconv.so (/usr/lib64/php/modules/iconv.so: undefined symbol: sapi_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/lib64/php/modules/intl (/usr/lib64/php/modules/intl: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/intl.so (/usr/lib64/php/modules/intl.so: undefined symbol: executor_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'ldap' (tried: /usr/lib64/php/modules/ldap (/usr/lib64/php/modules/ldap: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/ldap.so (/usr/lib64/php/modules/ldap.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: /usr/lib64/php/modules/mbstring (/usr/lib64/php/modules/mbstring: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mbstring.so (/usr/lib64/php/modules/mbstring.so: undefined symbol: sapi_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /usr/lib64/php/modules/mysqlnd (/usr/lib64/php/modules/mysqlnd: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mysqlnd.so (/usr/lib64/php/modules/mysqlnd.so: undefined symbol: core_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo' (tried: /usr/lib64/php/modules/pdo (/usr/lib64/php/modules/pdo: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pdo.so (/usr/lib64/php/modules/pdo.so: undefined symbol: executor_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'phar' (tried: /usr/lib64/php/modules/phar (/usr/lib64/php/modules/phar: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/phar.so (/usr/lib64/php/modules/phar.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: Module "posix" is already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'shmop' (tried: /usr/lib64/php/modules/shmop (/usr/lib64/php/modules/shmop: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/shmop.so (/usr/lib64/php/modules/shmop.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'simplexml' (tried: /usr/lib64/php/modules/simplexml (/usr/lib64/php/modules/simplexml: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/simplexml.so (/usr/lib64/php/modules/simplexml.so: undefined symbol: executor_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sodium' (tried: /usr/lib64/php/modules/sodium (/usr/lib64/php/modules/sodium: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/sodium.so (/usr/lib64/php/modules/sodium.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlite3' (tried: /usr/lib64/php/modules/sqlite3 (/usr/lib64/php/modules/sqlite3: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/sqlite3.so (/usr/lib64/php/modules/sqlite3.so: undefined symbol: core_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sysvmsg' (tried: /usr/lib64/php/modules/sysvmsg (/usr/lib64/php/modules/sysvmsg: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/sysvmsg.so (/usr/lib64/php/modules/sysvmsg.so: undefined symbol: executor_globals)) in Unknown on line 0
PHP Warning: PHP Startup: sysvsem: Unable to initialize module
Module compiled with build ID=API20240924,NTS
PHP compiled with build ID=API20240924,TS
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: sysvshm: Unable to initialize module
Module compiled with build ID=API20240924,NTS
PHP compiled with build ID=API20240924,TS
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'tokenizer' (tried: /usr/lib64/php/modules/tokenizer (/usr/lib64/php/modules/tokenizer: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/tokenizer.so (/usr/lib64/php/modules/tokenizer.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xml' (tried: /usr/lib64/php/modules/xml (/usr/lib64/php/modules/xml: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/xml.so (/usr/lib64/php/modules/xml.so: undefined symbol: executor_globals)) in Unknown on line 0
PHP Warning: Module "xmlwriter" is already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xsl' (tried: /usr/lib64/php/modules/xsl (/usr/lib64/php/modules/xsl: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/xsl.so (/usr/lib64/php/modules/xsl.so: undefined symbol: executor_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib64/php/modules/mysqli (/usr/lib64/php/modules/mysqli: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mysqli.so (/usr/lib64/php/modules/mysqli.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib64/php/modules/pdo_mysql (/usr/lib64/php/modules/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pdo_mysql.so (/usr/lib64/php/modules/pdo_mysql.so: undefined symbol: executor_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib64/php/modules/pdo_sqlite (/usr/lib64/php/modules/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/pdo_sqlite.so (/usr/lib64/php/modules/pdo_sqlite.so: undefined symbol: core_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'xmlreader' (tried: /usr/lib64/php/modules/xmlreader (/usr/lib64/php/modules/xmlreader: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/xmlreader.so (/usr/lib64/php/modules/xmlreader.so: undefined symbol: executor_globals)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/lib64/php/modules/zip.so (/usr/lib64/php/modules/zip.so: undefined symbol: compiler_globals), /usr/lib64/php/modules/zip.so.so (/usr/lib64/php/modules/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'apcu.so' (tried: /usr/lib64/php/modules/apcu.so (/usr/lib64/php/modules/apcu.so: undefined symbol: zend_signal_globals), /usr/lib64/php/modules/apcu.so.so (/usr/lib64/php/modules/apcu.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.4.4 (cli) (built: Mar 11 2025 12:29:16) (ZTS)
Copyright (c) The PHP Group
Zend Engine v4.4.4, Copyright (c) Zend Technologies
with Zend OPcache v8.4.4, Copyright (c), by Zend TechnologiesIt recognises some as already loaded: PHP Warning: Module "exif" is already loaded in Unknown on line 0, as they're compiled into the binary, some fail to load due to NTS/TS differences: PHP Warning: PHP Startup: sysvshm: Unable to initialize module
Module compiled with build ID=API20240924,NTS
PHP compiled with build ID=API20240924,TSBut still fails to unrecognised symbols for the only one that I care about: PHP Warning: Failed loading Zend extension 'opcache' (tried: /usr/lib64/php/modules/opcache (/usr/lib64/php/modules/opcache: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/opcache.so (/usr/lib64/php/modules/opcache.so: undefined symbol: compiler_globals)) in Unknown on line 0
PHP Warning: Failed loading Zend extension 'xdebug.so' (tried: /usr/lib64/php/modules/xdebug.so (/usr/lib64/php/modules/xdebug.so: undefined symbol: compiler_globals), /usr/lib64/php/modules/xdebug.so.so (/usr/lib64/php/modules/xdebug.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 |
|
@DubbleClick Let's create a new issue to start this. I haven't really looked into the possibility of dynamically loading extensions, but it should be possible in theory. For xdebug and opcache, I suspect that it may be the phpmicro patch that affects the results when it is dynamically compiled, but maybe we should start with normal extensions first. |
|
I think normal extensions aren't all too useful, at least when creating a NTS build. |
What does this PR do?
config/env.custom.iniBasic usage:
Checklist before merging
src/global/test-extensions.php../docs/.config/xxx.jsoncontent, runbin/spc dev:sort-config xxx.