How to monitor PHP-FPM instances

Created:

2016-11-16 13:06:16 UTC

Modified:

2017-08-16 16:12:47 UTC

1

Was this article helpful?


Have more questions?

Submit a request

How to monitor PHP-FPM instances

Applicable to:

  • Plesk for Linux

Question

How to enable pm.status_path and ping.path directives in order to monitor each instance of PHP-FPM (native, plesk-php56-fpm, plesk-php70-fpm and etc.)?

Answer

  1. Add required directives to [php-fpm-pool-settings] section in the /var/www/vhosts/system/example.com/conf/php.ini file.

    [root@server ~]# cat /var/www/vhosts/system/example.com/conf/php.ini
    [php-fpm-pool-settings]
    pm.status_path = /status
    ping.path = /ping

    Note: if there is no such file, create a new one.

  2. Go to Domains > example.com > PHP Settings and set PHP to FPM application served by nginx .

  3. Go to Domains > example.com > Apache & nginx Settings and add the following directives under Additional nginx directives section :

    location ~ ^/(status|ping)$ {
    fastcgi_split_path_info ^((?U).+\\.php)(/?.+)$;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_pass "unix:///var/www/vhosts/system/example.com/php-fpm.sock";
    include /etc/nginx/fastcgi.conf;
    }

Additional Information

How to change PHP-FPM pool settings for a domain in Plesk?

Have more questions? Submit a request

5 Comments

  • 0
    Avatar
    Peter Debik

    I tried to solve https://talk.plesk.com/threads/file-not-found-on-php-fpm-status-page.342581/ , rebuilt the configuration on a test system here and came to the same conclusion as the other user: It does not work, only displays "File not found". I tried several things, e.g. replacing fastcgi_param line with "fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;" as described in threads throughout the Internet, but only got the "File not found" result. Onyx 17.5 on CentOS 7.3 64-Bit. What's the correct solution?

  • 0
    Avatar
    Andrey Ivanov

    Hello Peter,

    The article has been modified accordingly. Please feel free to check it.

  • 0
    Avatar
    Sebastian Jankord

    Same here... only File not Found.

    Ubuntu 16.04 with Plesk 17.5.3

  • 0
    Avatar
    Peter Debik

    I confirm that this solution works. Thank you.

  • 0
    Avatar
    Lev Iurev

    Hi Sebastian, please prvide me with more details.

Please sign in to leave a comment.