I'm running PHP 7.1.10 with Apache 2.4.6. There's a bunch of PHP modules that are probably not used in my application. Is there any performance boost disabling them?
# ls /etc/php.d
10-opcache.ini 20-dom.ini 20-gettext.ini 20-mbstring.ini 20-shmop.ini 20-sysvsem.ini 20-xsl.ini 30-wddx.ini
20-bz2.ini 20-exif.ini 20-gmp.ini 20-mysqlnd.ini 20-simplexml.ini 20-sysvshm.ini 20-zip.ini 30-xmlreader.ini
20-calendar.ini 20-fileinfo.ini 20-iconv.ini 20-pdo.ini 20-sockets.ini 20-tokenizer.ini 30-mysqli.ini opcache-default.blacklist
20-ctype.ini 20-ftp.ini 20-imap.ini 20-phar.ini 20-sqlite3.ini 20-xml.ini 30-pdo_mysql.ini
20-curl.ini 20-gd.ini 20-json.ini 20-posix.ini 20-sysvmsg.ini 20-xmlwriter.ini 30-pdo_sqlite.ini
Example, 20-posix.ini:
# cat /etc/php.d/20-posix.ini
; Enable posix extension module
extension=posix.so
Can I safely disable most modules, or is there no significant performance boost?
Usually core extensions does not have real impact on performances. But some knowns extensions are really performances-killing like Xdebug (which should be strictly reserved to dev environment).
However if you plan to not make use of some specific extensions you can still make a quick benchmark to test if there's a notable performances changes.
But to be honest as of php7, they highly improved performances by removing old and greedy code, unsupported SAPI, etc. So you should not be worried at all about that.