在ubuntu 16.04上設定fpm status
- 配置Server設定 /etc/nginx/sites-available/default
server {
listen 80;
listen [::]:80;
listen 9000;
location ~ ^/(php_fpm_status|php_fpm_ping)$ {
access_log off;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
}
}
修改 /etc/php/7.1/fpm/pool.d/www.conf 的配置,將 status 打開
pm.status_path = /php_fpm_status
ping.path = /php_fpm_ping
ping.response = pong
設定完畢後,重啟 nginx 和 php-fpm 服務,可以看status的時間來觀察是否成功重啟
sudo systemctl restart nginx
sudo systemctl status nginx
sudo systemctl restart php7.1-fpm
sudo systemctl status php7.1-fpm
連至網址測試是否成功
<網址>/php_fpm_status
<網址>/php_fpm_ping
設定成功的話,在 php_fpm_status 頁面可以看到如下的資訊
設定成功的話,在 php_fpm_ping 頁面可以看到如下的資訊
Happy Coding