I'd like to determine the current config that is 'loaded'. These would be all the values listed here: http://php.net/manual/en/install.fpm.configuration.php
These values are not returned by phpinfo()
.
I'd like to determine the current config that is 'loaded'. These would be all the values listed here: http://php.net/manual/en/install.fpm.configuration.php
These values are not returned by phpinfo()
.
If you have access to server, try, depending on php version
sudo php-fpm7.0 -tt
sudo php-fpm7.x -tt
sudo php-fpm7.4 -tt
sudo php-fpm8.0 -tt
sudo php-fpm8.1 -tt
sudo php-fpm8.2 -tt
It test the current config file and show config params values (also default ones).
The displayed values can differs from current running config if a modification happened and php-fpm hasn't been reloaded.
Only tested out on php-fpm 8.1
Note: Output from the command goes to standard error and that makes piping to something like grep
or less
inconvenient. To account for this:
php-fpm8.2 -tt 2>&1 | grep access
There are two ways to check it out, as far as I know
root@c56686e9854c:/# ps aux | grep php-fpm | grep master
root 1 0.0 0.9 455112 37324 ? Ss 12:01 0:00 php-fpm: master process (/usr/local/etc/php-fpm.conf)
root@c56686e9854c:/# php-fpm -tt
[29-Mar-2020 12:31:23] NOTICE: [www]
...
[29-Mar-2020 12:31:23] NOTICE: pm = dynamic
[29-Mar-2020 12:31:23] NOTICE: pm.max_children = 5
[29-Mar-2020 12:31:23] NOTICE: pm.start_servers = 2
[29-Mar-2020 12:31:23] NOTICE: pm.min_spare_servers = 1
[29-Mar-2020 12:31:23] NOTICE: pm.max_spare_servers = 3
...
Axi's solution is not complete, in that the -tt flag merely displays the values of the current config files as they exist on the filesystem, not the values that are currently loaded into memory. These values may not necessarily be the same. For example, if an edit was made to the file, but fpm was not reloaded.
The best solution I found was to enable the FPM Status Page in Apache or Nginx. Although it doesn't display all variables, it's better than nothing.
You can use:
parse_ini_file(php_ini_loaded_file())