I have configured a new FPM pool (config file www.conf
in pool.d
), now let's say I want to disable mysql support for that specific pool ? Or maybe there is a way not to load that extension for that pool ?
I'm using debian 9 and here is how the file structure looks like this:
/etc/php/7.0/fpm$ tree
.
├── conf.d
│ ├── 10-mysqlnd.ini -> /etc/php/7.0/mods-available/mysqlnd.ini
│ ├── 10-opcache.ini -> /etc/php/7.0/mods-available/opcache.ini
│ ├── 10-pdo.ini -> /etc/php/7.0/mods-available/pdo.ini
│ ├── 20-calendar.ini -> /etc/php/7.0/mods-available/calendar.ini
│ ├── 20-ctype.ini -> /etc/php/7.0/mods-available/ctype.ini.ini
(...)
├── php-fpm.conf
├── php.ini
└── pool.d
├── forgewww.conf
└── www.conf
extension=thing.so
can be found in files conf.d/<extension>.ini
. Problem is all those extensions once configured seem common to all pools...
I've also tried to disable mysql extensions globally with phpdismod
then append a line in www.conf
with:
php_admin_value[extension] = mysqli.so
Which doesn't seems to work (the above doesn't enable mysqli for that pool)
You can't load different extension per-pool, the extensions are defined in an .ini
file, loaded by master process. php-fpm
master process forks into children, meaning that they share what's been loaded by the master process. You can't have a child load a different set of extensions after forking, or unload them. It probably is possible to develop a solution, but there's really no need for that seeing that you can solve your problem via different approach.
In order to achieve what you're after, simply set up entirely different php-fpm process on a different port / unix socket and load extensions you require, set up your pools and you're done. It's actually a lot less work than it sounds, it probably won't take you more than a few minutes.