Nginx 默认是不支持 PATHINFO 模式的,需要修改下 Nginx 的配置文件。 server { listen 80; root /var/www/html; index index.html index.htm index.PHP; server_name _; location / { try_files $uri $uri/ =404; } location ~ \.PHP(.
Nginx 默认是不支持 PATHINFO 模式的,需要修改下 Nginx 的配置文件。
server { listen 80; root /var/www/html; index index.html index.htm index.PHP; server_name _; location / { try_files $uri $uri/ =404; } location ~ \.PHP(.*)$ { include fastcgi_params; fastcgi_index index.PHP; fastcgi_pass unix:/run/PHP/PHP7.0-fpm.sock; fastcgi_split_path_info ^((?U).+\.PHP)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; } }