PHP-FPM 7.0 - Apache 2 and Ubuntu 14.04

July 28, 2016 440 views
Apache PHP Ubuntu

Hi all,

Can somebody point me at a guide for setting up the status monitoring for PHP-FPM in Apache? I've got this working from the command line with a simple script, but looking for what needs to be configured in apache2.conf and my virtualhost to be able to access the status of the PHP FPM pool via Apache.

Many thanks in advance,

  • And sorry, I've got it setup to listen on a port rather than working through a socket...

    ; listen = /run/php/php7.0-fpm.sock
    listen =
  • Please post your current fastcgi and Apache2 configurations. With more details we could help better!

  • This was the correct configuration in the end:

    <LocationMatch "/fpmstatus">
                 Order Allow,Deny
                 Allow from
                 ProxyPass fcgi://
            <LocationMatch "/fpmping">
                 Order Allow,Deny
                 Allow from
                 ProxyPass fcgi://
1 Answer

Use something like this in your fastcgi config:

<IfModule mod_fastcgi.c>
    AddType application/x-httpd-fastphp5 .php
    Action application/x-httpd-fastphp5 /php5-fcgi
    Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
    FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket -pass-header Authorization
    <Directory /usr/lib/cgi-bin>
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Require all granted
            Order allow,deny
            Allow from all

then you could use this in your Apache VHOST:

<LocationMatch "/(fpm-ping|fpm-status)">
     SetHandler php5-fcgi-virt
     Action php5-fcgi-virt /php5-fcgi virtual

Hope you can work with this

Have another answer? Share your knowledge.