微擎不同应用模块使用不同php版本

应用·源码 · 2022-12-03 · 90 人浏览

1.注意事项

服务器web服务必须是nginx,apache暂未做适配,php必须以php-fpm启动,即LNMP才支持,LNAMP和LAMP不支持。

服务器同时安装了php5.6和php7.1,php5.6和php7.1已经同时启动。

2.开始配置

修改nginx配置文件

宝塔站点管理点击您想配置的站点,选择配置文件,我们先将33行左右的include enable-php-xx.conf前加#注释掉然后加入如下代码

location ~ [^/]\.php(/|$)

    {    

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

        fastcgi_index index.php;

        include fastcgi.conf;

        include pathinfo.conf;

        if ($request_uri ~* "ndot_ladderbuy"){   

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

        }   

    }
微擎
豫ICP备17047052号-1