Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I determine the current config of php-fpm?

Tags:

php

fpm

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().

like image 629
Chris Stryczynski Avatar asked May 28 '18 07:05

Chris Stryczynski


People also ask

Where can I find PHP-FPM conf?

conf file should be in /etc/php/7.2/fpm/pool.

How can I tell if PHP-FPM is running?

First open the php-fpm configuration file and enable the status page as shown. Inside this file, find and uncomment the variable pm. status_path = /status as shown in the screenshot. Save the changes and exit the file.

What is PHP-FPM conf?

The php-fpm service creates a default pool, the configuration (www.conf) for which can be found in /etc/php/7.3/fpm/pool.d folder. You can customize the default pool as per your requirements. But it is a standard practice to create separate pools to have better control over resource allocation to each FPM processes.


2 Answers

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 

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 7.4

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-fpm7.4 -tt 2>&1 | grep access 
like image 157
Axi Avatar answered Sep 20 '22 21:09

Axi


There are two ways to check it out, as far as I know

  1. use ps command to locate the fpm config file and read it
 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)

  1. use php-fpm's own command
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

...

like image 29
Randy Lam Avatar answered Sep 21 '22 21:09

Randy Lam