Tips for debugging fcgi

Marcos Neves marcos.neves at
Fri May 28 07:03:53 MSD 2010

I found a easy way to debugging fcgi.
easy_install flup
wget -O
chmod +x
# run using &
# remender to stop any other server running on port 9000 or change the
port number on

# sample nginx configuration
    location ~ ^(.+\.php)(.*)$ {
      fastcgi_split_path_info ^(.+\.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;
      fastcgi_param SERVER_NAME $http_host;
      fastcgi_param SERVER_PORT $server_port;
      fastcgi_param SERVER_PROTOCOL $server_protocol;
      fastcgi_param REQUEST_METHOD $request_method;

now you can see all env variables and check if its all ok.

What are the required variables that PHP need to work? SCRIPT_FILENAME only?

fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
works only when I set cgi.fix_pathinfo=1 on php.ini
Is it a good practice?

Marcos Neves
+55 44 9918-8488

More information about the nginx mailing list