刚部署好的lnmp服务器,将thinkphp5项目扔上去的时候 无论你访问那个url 都会404错误,这是因为config 还没有完全
配置好
远程连接桌面,进去 /usr/local/nginx/conf/enable-php.conf
在方法中加入
set $fastcgi_script_name2 $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") {
set $fastcgi_script_name2 $1;
set $path_info $2;
}
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2;
fastcgi_param SCRIPT_NAME $fastcgi_script_name2;
重启即可
顺便提醒一句 如果好了之后出现
scandir() has been disabled for security reasons
那就
cd /usr/local/php/etc
搜索scandir (/scandir )后删掉,保存重启即可。