Available modules, some that come with PHP, and some we installed ourselves, are available in
These are set per SAPI -
apache2 being the most common.
So, for web requests, we can check out the
fpm section, and specifically the
ls -lah /etc/php/7.1/conf.d
We see a bunch of symlinks to the
Enable / Disable
To enable or disable a module for a SAPI, we can create or destroy a symlink in the
conf.d directory for that SAPI. We'll need to restart php-fpm if we change it, but CLI-run PHP is affected immediately (since each call to
php on the command line is starting a new process).
Note that this means your cron tasks / queue workers may have a different php.ini and set of modules than your web-run php.
We can also use the simpler
phpdismod commands. Use the
-s flag to define a specific SAPI if you don't want all of them affected.
# Disable xdebug for php-fpm
sudo phpdismod -s fpm xdebug
sudo service php7.1-fpm reload