自动重启故障相信大家都遇到过,原因也有很多,跟系统,硬件或者外界因素都有关。最近服务器时不时出现Nginx 502 Bad Gateway,如果在电脑旁边还好,要是半夜或者出去了,怎么办?
没关系,写个脚本检测服务状态,发现异常,自动重启。
自动重启脚本:
复制代码 代码如下:
$url = 'http://blog.rebill.info';
$cmd = '/usr/local/php/sbin/php-fpm restart';
请关闭浏览器的畅读模式或者取消屏蔽JavaScript的正常运行,避免出现内容显示不全或者段落错乱。
原网页地址:https://www.potelypower.com/xuexi/4023355.html