闲者博客 - 执行 https://bk1314.com/tag/%E6%89%A7%E8%A1%8C/ zh-CN Wed, 23 Feb 2022 16:16:00 +0800 Wed, 23 Feb 2022 16:16:00 +0800 宝塔单网站多PHP执行不同文件 https://bk1314.com/10.html https://bk1314.com/10.html Wed, 23 Feb 2022 16:16:00 +0800 飞鱼 [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;

  }   
}

宝塔配置文件替换位置

]]>
0 https://bk1314.com/10.html#comments https://bk1314.com/feed/tag/%E6%89%A7%E8%A1%8C/