-
1#
goe
-
收藏
2024-5-23 19:07:59
怎么同域名不同目录使用不同php版本
求助巨佬
php70映射服务器7033端口
php74映射服务器7433端口
在配置里a目录使用127.0.0.1:7433可以正常使用
在配置里b目录使用127.0.0.1:7033报错403
好像是php70没有被使用,使用php70容器ip也一样不行。
配置如下:
#主站点php74
location /a {
try_files $uri $uri/ /a/index.php?$query_string;
}
location ~ ^/a/(.*\.php)$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:7433;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
# 子站点 PHP 处理(使用不同的 PHP-FPM 在 127.0.0.1:7033)
location /a/site2 {
alias /www/wwwroot/site2/index;
try_files $uri $uri/ /a/site2/index.php?$query_string;
}
location ~ ^/a/site2/(.*\.php)$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:7033;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}