修改nginx/conf/nginx.conf里 server下root项目入口文件目录
server { listen 80 default_server reuseport; #listen [::]:80 default_server ipv6only=on; server_name _; index index.html index.htm index.php; #root /home/wwwroot/default; root /home/wwwroot/www.shiyayun.cn/public;
nginx/conf/nginx.conf里server下新增 location /
location / { index index.html index.htm index.php; try_files $uri $uri/ /index.php?$query_string; #隐藏index.php }
注释nginx/conf/enable-php.conf 里的try_files $uri =404;
location ~ [^/].php(/|$) { #try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; }
注释nginx/conf/fastcgi.conf里 PHP_ADMIN_VALUE
fastcgi_param REDIRECT_STATUS 200; #fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
修改php.ini文件cgi.fix_pathinfo值为1
vi /usr/local/php/etc/php.ini
;修改值0为1 cgi.fix_pathinfo=1
lnmp restart重启环境