当前位置:Gxlcms > PHP教程 > 开启php-fpmstatus功能,访问domain/status,结果404?

开启php-fpmstatus功能,访问domain/status,结果404?

时间:2021-07-01 10:21:17 帮助过:6人阅读

1.nginx default 配置增加

location ~ ^/(status|ping)$
        {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php5.6-fpm.sock;
        }

2.开启pm.status = /status
3.重启nginx和fpm,service nginx restart,service php-fpm restart

访问:http://192.168.10.10/status
结果:404

回复内容:

1.nginx default 配置增加

location ~ ^/(status|ping)$
        {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php5.6-fpm.sock;
        }

2.开启pm.status = /status
3.重启nginx和fpm,service nginx restart,service php-fpm restart

访问:http://192.168.10.10/status
结果:404

Nginx:
    location ~ ^/(status|ping)$ {
        include        fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index  index.php;
    }

我试了,访问/status能正常输出PHP-FPM的工作信息.
你是不是访问时在/status后面多加了个/,这时就会返回404了.

人气教程排行