闲者博客 - 宝塔 2022-02-23T17:23:00+08:00 Typecho https://bk1314.com/feed/atom/tag/%E5%AE%9D%E5%A1%94/ <![CDATA[宝塔定时任务监测502就重启]]> https://bk1314.com/16.html 2022-02-23T17:23:00+08:00 2022-02-23T17:23:00+08:00 飞鱼 http://www.typecho.org 下面代码复制在宝塔定时任务 设置shell命令 建议5分钟监测一次 56是php版本哦PHP7.2就是72

#!/bin/bash
if [[ `curl -sS --connect-timeout 15 -m 15 127.0.0.1/phpfpm_56_status|grep 502` == *"502"* ]]; then
/etc/init.d/php-fpm-56 stop
/etc/init.d/php-fpm-56 start
else
echo php56 normal.
fi
]]>
<![CDATA[宝塔单网站多PHP执行不同文件]]> https://bk1314.com/10.html 2022-02-23T16:16:00+08:00 2022-02-23T16:16:00+08:00 飞鱼 http://www.typecho.org [scode type="green"]下面代码放到配置文件里[/scode]

     location ~ [^/]\.php(/|$)
    {  
    # 默认调用PHP7.2
     try_files $uri =404;
    fastcgi_pass  unix:/tmp/php-cgi-72.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
    include pathinfo.conf;

      # 当url中包含/qy_wmdc/则调用5.6版本
  if ($request_uri ~* "/qy_wmdc/"){

    fastcgi_pass unix:/tmp/php-cgi-56.sock;

  }   
}

宝塔配置文件替换位置

]]>