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 6 extra extensions
#pecl install memcached (https://pecl.php.net/package/memcached)
#pecl install memcached (https://pecl.php.net/package/memcached)
#pecl install php-psr (https://github.com/jbboehr/php-psr)
#pecl install redis (https://pecl.php.net/package/redis)
#pecl install suhosin.org (https://suhosin.org/)
#pecl install yaml (https://pecl.php.net/package/yaml)
;;;;;;;;;;;;;;;;;;;;;;;;
; PHP configure list ;
;;;;;;;;;;;;;;;;;;;;;;;;
./configure
--without-iconv
--enable-intl
--enable-mbstring
--with-libmbfl=DIR
--enable-mbstr-enc-trans
--disable-mbregex
--enable-memcache
--disable-memcache-session
--with-libmemcached-dir=DIR
--with-zlib-dir=DIR
--disable-memcached-session
--enable-memcached-sasl
--enable-opcache
--disable-pdo
--without-pear
--disable-posix
--enable-psr
--enable-redis
--disable-redis-session
--enable-redis-igbinary
--enable-simplexml
--without-sqlite3
--enable-suhosin
--enable-suhosin-experimental
--disable-tokenizer
--disable-xml
--disable-xmlreader
--with-xmlrpc[=DIR]
--disable-xmlwriter
--with-yaml[[=DIR]
--enable-zip
--with-libzip=DIR
; For debug purposes
;--enable-dtrace
;--disable-phpdbg
;--enable-zend-signals
;--disable-opcache