This is a suggestion of compilation directive to use when compiling PHP specifically for the audited code.
The selection made below is based on the extension usage, found in the code (--enable, --with) and also the absence of usage (--disable, --without).
Some local extensions (--pdo-mysql, --with-libmbfl...) are also mentionned for help.
# install one extra extension
#pecl install swoole-src (https://github.com/swoole/swoole-src)
;;;;;;;;;;;;;;;;;;;;;;;;
; PHP configure list ;
;;;;;;;;;;;;;;;;;;;;;;;;
./configure
--enable-bcmath
--with-curl=DIR
--disable-dom
--disable-fileinfo
--with-gettext=DIR
--with-gmp
--without-iconv
--enable-intl
--with-ldap[=DIR]
--with-ldap-sasl[=DIR]
--disable-libxml
--enable-mbstring
--with-libmbfl=DIR
--enable-mbstr-enc-trans
--disable-mbregex
--with-openssl[=DIR]
--enable-pcntl
--disable-pdo
--with-readline=[DIR]
--enable-sockets
--with-swoole
--enable-swoole-debug, --enable-sockets, --enable-ringbuffer, --enable-async-redis, --enable-openssl, --enable-http2, --enable-thread, --enable-hugepage, --enable-swoole, --enable-mysqlnd, --enable-coroutine, --enable-picohttpparser, --enable-timewheel
--disable-tokenizer
--disable-xmlreader
--with-xmlrpc[=DIR]
--disable-xmlwriter
--with-zlib=DIR
; For debug purposes
;--enable-dtrace
;--disable-phpdbg
;--enable-zend-signals
;--disable-opcache