歡迎您光臨本站 註冊首頁

windows 下安裝nginx 出現 No input file specified.

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

windows 下安裝nginx 出現 No input file specified.

軟體都安裝在 E:\WAMP目錄下,例如E:\WAMP\php ,E:\WAMP\nginx

我網站的根目錄是:E:\website,下面只有一個index.php文件,裡面是phpinfo()這個函數

nginx的配置文件如下

nginx.conf文件內容


#user  nobody;
worker_processes  1;

error_log  logs/error.log;
pid        logs/nginx.pid;

events {
    worker_connections  64;
}


http {
    include       /cygdrive/e/wamp/nginx/conf/mime.types;
    default_type  application/octet-stream;  

    #sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  60;

    client_body_temp_path   /cygdrive/e/wamp/nginx/temp/client_body_temp;
    proxy_temp_path         /cygdrive/e/wamp/nginx/temp/proxy_temp_path;
    fastcgi_temp_path       /cygdrive/e/wamp/nginx/temp/fastcgi_temp_path;
    gzip  on;
        fastcgi_intercept_errors on;

    #vhosts settings
    include       /cygdrive/e/wamp/nginx/conf/vhost80.conf;
}



vhost80.conf文件內容

server {
    listen       85;
    server_name  localhost;      
    charset      utf-8;

    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   /cygdrive/e/wamp/nginx/logs/access.log  main;
   
   
    # static resources
    #location ~* ^.+\.(html|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
    #{
    #    expires 30d;
    #    break;
    #}

       

    location / {
                index                        index.html index.php;
        fastcgi_pass   127.0.0.1:9000;
        include        /cygdrive/e/wamp/nginx/conf/fastcgi_params;
    }


    # php scripts
    location ~ .*\.php?$
    {
                root         /cygdrive/e/website/;
        fastcgi_pass   127.0.0.1:9000;
        include        /cygdrive/e/wamp/nginx/conf/fastcgi_params;
    }

    # error pages
    #error_page   401 403 404 500 502 503 504  /error.html;
    #location = /error.html {
    #        access_log   off;
    #}
}


fastcgi_params文件內容:

#fastcgi_pass unix:/opt/nginx/logs/django.sock;

fastcgi_index                     index.php;
fastcgi_pass_header               Authorization;
fastcgi_intercept_errors          off;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

《解決方案》

No input file specified這個問題出現的地方,多是在windowns伺服器系統下iis下的ISAPI模式下。目前有兩個解決的例子:

1,把PHP.INI里的
doc_root ="
註釋掉就可以了。

2,有人升級了php版本到5.2了,就解決了,原文如下:

也回應一下,現在伺服器將PHP升級到5.2,ZEND也換成3.2,並且eAccelerator v0.9.5-rc1換成了eAccelerator v0.9.5

問題現在基本沒有出現了。並且感覺負載方面也好了點,運行 速度快了。(PHP.INI配置還是一樣,沒有更改過什麼,MYSQL還是用4.0.26)

在網上(DZ官方上也有)有人說PHP5.2解決了W3WP出錯的問題了。我想我原來出現問題也是因為W3WP出錯造成的(系統日誌里也提示有錯誤的)


我在google中找到的:http://www.liushen.net/post/24.html

[火星人 ] windows 下安裝nginx 出現 No input file specified.已經有824次圍觀

http://coctec.com/docs/service/show-post-24744.html