vi /root/php-fpm.sh #!/bin/bash php_url="http://localhost/hscheck.php" RESULT='curl -I $php_url | grep "HTTP/1.1 502"' if [ -n "$RESULT" ]; then killall -9 php-fpm service php-fpm restart fichmod 755 /rorot/php-fpm.sh加入排程 */1 * * * * /root/php-fpm.sh參考 https://blog.csdn.net/weixin_42410566/article/details/115757768