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 php-ffi (https://github.com/dstogov/php-ffi)
;;;;;;;;;;;;;;;;;;;;;;;;
; PHP configure list ;
;;;;;;;;;;;;;;;;;;;;;;;;
./configure
--disable-ctype
--disable-dom
--with-ffi[=DIR]
--disable-fileinfo
--disable-filter
--disable-hash
--without-iconv
--disable-libxml
--disable-pdo
--without-pear
--disable-posix
--disable-session
--without-sqlite3
--disable-tokenizer
--disable-xml
--disable-xmlreader
--with-xmlrpc[=DIR]
--disable-xmlwriter
; For debug purposes
;--enable-dtrace
;--disable-phpdbg
;--enable-zend-signals
;--disable-opcache