Reputation: 395
I've read that I can set per worker php.ini file as stated here https://www.php.net/manual/en/install.fpm.php
ability to start workers with different uid/gid/chroot/environment, listening on different ports and using different php.ini (replaces safe_mode);
but I connot find any config variable pointing to that file. All I've found (via Google) is to overwrite php.ini directives in worker configuration. Is this only way, if no then how i can specify per worker php.ini file?
Upvotes: 2
Views: 2772
Reputation: 441
I needed to set different php.ini for PHP-FPM pool (for setting Xdebug mode), which is impossible (as written above) and so I had to run another instance of PHP-FPM service where you can use --php-ini argument to pass specific php.ini file.
Resources:
Upvotes: 0
Reputation: 41
It apperas that it's impossible to load different php.ini per worker BUT we can Pass environment variables and PHP settings to a pool (worker), which is like loading different php.ini file
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]
php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 32M
source http://www.php.net/manual/en/install.fpm.configuration.php
Upvotes: 4