Fix nginx PHP "No input file specified"
Local Apache, switch to nginx1.0.11,
The configuration file is as follows:
#user nobody;worker_processes 1;error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid;events {worker_connections 1024;} HTTP {include mime.types; Default_type Application/octet-stream; #log_format Main ' $remote _addr-$remote _user [$time _local] "$request" ' # ' $status $body _bytes_sent "$http _referer" ' # ' "$http _user_agent" "$http _x_forwarded_for"; #access_log Logs/access.log Main; Sendfile on; #tcp_nopush on; #keepalive_timeout 0; Keepalive_timeout 65; #gzip on; server {listen 8080; server_name Localhost;charset Utf-8; #charset Koi8-r; #access_log Logs/host.access.log Main; Location/{root HTML; Index index.html index.htm Index.php;autoindex on; } #error_page 404/404.html; # REDIRECT Server error pages to the Static page/50x.html # Error_page 502 503 504/index2.html; Location =/index2.html {root html; } # Proxy The PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ {# ProX Y_pass http://127.0.0.1; #} # Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { #root D:\test; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; } # Deny access to. htaccess files, if Apache ' s document Root # concurs with Nginx ' s one # #lo cation ~/\.ht {# deny all; #}} # Another virtual host using mix of ip-, name-, and port-based configuration # #server {# listen 8000; # Listen somename:8080; # sErver_name somename alias Another.alias; # location/{# root HTML; # index index.html index.htm; #} #} # HTTPS Server # #server {# listen 443; # server_name localhost; # SSL on; # ssl_certificate Cert.pem; # Ssl_certificate_key Cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers high:!anull:! MD5; # ssl_prefer_server_ciphers on; # location/{# root HTML; # index index.html index.htm; # } #}}
? The main thing is:
1. Change PHP.ini
First, the configuration of the php.ini
; cgi.fix_pathinfo=0?? Switch
Cgi.fix_pathinfo=1
2. In nginx/conf/nginx.conf?? Found it:
Fastcgi_param? Script_filename? /scripts$fastcgi_script_name;? Switch
Fastcgi_param script_filename $document _root$fastcgi_script_name;
?