我也遇到这个问题了,Mac 本地, 开发环境是docker, 安装nginx1.19.1,PHP 7.4.7,
配置文件,改了这里为:
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass php:9000;
include fastcgi-php.conf;
include fastcgi_params;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
可能是phpinfo解析规则问题。你参考下这个地址看能否有帮助:https://www.hkcms.cn/help/azbs/112.html。或可以联系我。
我也遇到这个问题了,Mac 本地, 开发环境是docker, 安装nginx1.19.1,PHP 7.4.7,
配置文件,改了这里为:
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass php:9000;
include fastcgi-php.conf;
include fastcgi_params;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
除了首页外,其他仍是报404. 请问有什么其他办法吗?
@yyii set $real_script_name这块区域你参考这里试下:https://www.hkcms.cn/help/azbs/112.html
@luo @luo 太好了,谢谢你的回复!