I'm trying to get my php7.4-fpm status page to show up on an URL. I'm running an Apache 2.4.41 server. Instead, I am getting a "File Not Found." error.
Here is what I've done. First I edited:
/etc/php/7.4/fpm/pool.d/www.conf
I uncommented and edited two lines:
pm.status_path = /status
ping.path = /ping
Next, I went to my website's apache configuration file:
/etc/apache2/sites-enabled/mywebsite.com.conf
and added the lines:
<VirtualHost *:443>
ServerAlias mywebsite.com
DocumentRoot /home/mywebsite/mywebsite.com
# added these lines to get the php status page to show up
<LocationMatch "/(ping|status)">
SetHandler "proxy:unix:/run/php/php7.4-fpm.mywebsite.sock|fcgi://localhost/status"
</LocationMatch>
</VirtualHost>
It seems like this should be a simple setup, but I've spent hours unsuccessfully trying to get the status page working to diagnose unexplained php-fpm problems that started up a few days ago with all the php-fpm processes being used on all websites.
Now I'm resigned to playing the shotgun game trying different handlers in an attempt to get something working:
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost/status"
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost/"
SetHandler "proxy:unix:/run/php/php7.4-fpm.mywebsite.sock|fcgi://localhost"
If I try "proxy:unix:/run/php/php7.4-fpm.sock", which is what the www.conf actually listens on, I get a 503 Service Unavailable.
If I try my website socket "proxy:unix:/run/php/php7.4-fpm.mywebsite.sock", the page actually loads up, but it just shows a "File Not Found", and it doesn't matter if it's "fcgi://localhost/status" or "fcgi://localhost". I don't know what the deal is.