Package: nginx
Version: 0.7.67-3
Severity: normal

I'm using nginx to talk to a php-cgi process running with -b (as a fastcgi 
server).

php-cgi was repeatably returning "No input file specified", and wasn't
even looking for the file, despite what looked to me like reasonable
clues in the fcgi communications coming from nginx.

It turns out php-cgi's fastcgi handler wants to see SCRIPT_FILENAME
instead of (or maybe in addition to?) SCRIPT_NAME.

In particular, adding the following line to /etc/nginx/fastcgi_params
made everything work for me, after much gnashing of teeth:

  fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name; 

(i don't know the fastcgi spec well, but stracing other fcgi
setups suggests they use SCRIPT_FILENAME too).

maybe this needs to be included in fastcgi_param to work with php-cgi -b?

      --dkg

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages nginx depends on:
ii  libc6                 2.11.2-7           Embedded GNU C Library: Shared lib
ii  libgeoip1             1.4.7~beta6+dfsg-1 A non-DNS IP-to-country resolver l
ii  libpcre3              8.02-1.1           Perl 5 Compatible Regular Expressi
ii  libssl0.9.8           0.9.8o-4           SSL shared libraries
ii  lsb-base              3.2-23.1           Linux Standard Base 3.2 init scrip
ii  zlib1g                1:1.2.3.4.dfsg-3   compression library - runtime

nginx recommends no packages.

nginx suggests no packages.

-- Configuration Files:
/etc/nginx/fastcgi_params changed:
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  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  SCRIPT_FILENAME    $document_root$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  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;
fastcgi_param  REDIRECT_STATUS    200;

/etc/nginx/nginx.conf changed:
user www-data;
worker_processes  1;
error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;
events {
    worker_connections  1024;
    # multi_accept on;
}
http {
    include       /etc/nginx/mime.types;
    access_log  /var/log/nginx/access.log;
    sendfile        on;
    #tcp_nopush     on;
    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;
    gzip  on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
    # added this due to complaints from nginx reload script 2010-06-07
    server_names_hash_bucket_size 64;
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

/etc/nginx/sites-available/default changed:
server {
        listen   80 default;
        server_name  che.mayfirst.org;
        access_log  /var/log/nginx/localhost.access.log;
        location / {
                root   /srv/www/che.mayfirst.org;
                index  index.html index.htm;
        }
        # location /doc {
        #       root   /usr/share;
        #       autoindex on;
        #       allow 127.0.0.1;
        #       deny all;
        # }
        # location /images {
        #       root   /usr/share;
        #       autoindex on;
        # }
        #error_page  404  /404.html;
        # redirect server error pages to the static page /50x.html
        #
        #error_page   500 502 503 504  /50x.html;
        #location = /50x.html {
        #       root   /var/www/nginx-default;
        #}
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
                #proxy_pass   http://127.0.0.1;
        #}
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
                #fastcgi_pass   127.0.0.1:9000;
                #fastcgi_index  index.php;
                #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
                #includefastcgi_params;
        #}
        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
                #deny  all;
        #}
}


-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to