默认的lnmp没有开启pathinfo模式,但很多框架需要用到。
cd /usr/local/nginx/conf
vim enable-php.conf
location ~ [^/]\.php(/|$) { # comment try_files $uri =404; to enable pathinfo #try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; include pathinfo.conf;#新增pathinfo模式 }
service nginx restart
OK
时间: 2024-10-18 09:38:54