Using PHP7.3 FPM along with Apache 2.4.25 I have a problem when enabling PHP FPM status page.

What is working:

# /etc/php/7.3/fpm/pool.d/www.conf
listen = /run/php/php7.3-fpm.sock
pm.status_path = /status-php

# /etc/apache2/sites-enabled/status.conf
<VirtualHost [::1]:80>
        ServerName localhost
        DocumentRoot /var/www
        <Location /status-php>
                SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost"

But what does not work is replacing /status-php with /status/php in both files (PHP and Apache config). This results in 404 and an Apache error saying:

AH01071: Got error 'Primary script unknown'

What is the reason for that? Why is the subfolder-variant not working?

  • Is the "php" content identical to the one in "status-php" ? – Overmind Jul 28 at 8:41
  • Sure, both should return internal status page of PHP-FPM. – rabudde Jul 28 at 9:06
  • php-fpm requires the SCRIPT_NAME and SCRIPT_FILENAME parameters to correspond to the value of pm.status_path setting. Make sure this is right. – Overmind Jul 28 at 11:13

I solved it my own by replacing

<Location /status-php>
    SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost"


ProxyPass "/status/php" "unix:/run/php/php7.3-fpm.sock|fcgi://localhost"

This way, I can reach PHP-FPM status page via /status/php now. No clue why Apache handler fails.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.