要配置PHP Supervisor,可以按照以下步驟進(jìn)行操作:
sudo apt-get install supervisor
sudo nano /etc/supervisor/conf.d/php-worker.conf
[program:php-worker]
command=php /path/to/your/php/script.php
autostart=true
autorestart=true
stderr_logfile=/var/log/php-worker.err.log
stdout_logfile=/var/log/php-worker.out.log
注意替換/path/to/your/php/script.php
為你實(shí)際的PHP腳本路徑。
sudo supervisorctl reread
sudo supervisorctl update
sudo service supervisor start
現(xiàn)在,PHP Supervisor已經(jīng)配置完成并啟動(dòng),可以監(jiān)控并管理PHP進(jìn)程。