Rumah > Artikel > pembangunan bahagian belakang > 开启php-fpm status功能,访问domain/status,结果404?
1.nginx default 配置增加
<code>location ~ ^/(status|ping)$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php5.6-fpm.sock; }</code>
2.开启pm.status = /status
3.重启nginx和fpm,service nginx restart,service php-fpm restart
访问:http://192.168.10.10/status
结果:404
1.nginx default 配置增加
<code>location ~ ^/(status|ping)$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php5.6-fpm.sock; }</code>
2.开启pm.status = /status
3.重启nginx和fpm,service nginx restart,service php-fpm restart
访问:http://192.168.10.10/status
结果:404
<code>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; }</code>
我试了,访问/status能正常输出PHP-FPM的工作信息.
你是不是访问时在/status后面多加了个/,这时就会返回404了.