大网数据广告活动
服务器运维问答

PHP status page not working in Apache

· 52CE 我爱测

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…

问题原文

原帖链接 · rabudde · CC BY-SA 4.0

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 127.0.0.1:80>
        ServerName localhost
        DocumentRoot /var/www
        <Location /status-php>
                SetHandler "proxy:unix:/run/php/php7.3-fpm.sock|fcgi://localhost"
        </Location>
</VirtualHost>

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?

已采纳解答

原帖链接 · rabudde · CC BY-SA 4.0

I solved it my own by replacing

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

with

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-07-26)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。