# Tips for debugging fcgi

**URL:** <https://www.ruby-forum.com/t/tips-for-debugging-fcgi/189290>\
**Category:** NGINX\
**Created:** [May 28, 2010, 5:04am UTC](https://www.ruby-forum.com/t/tips-for-debugging-fcgi/189290 "2010-05-28T05:04:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcos\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@Marcos\_N](https://www.ruby-forum.com/u/Marcos_N)\
**Post date:** [May 28, 2010, 5:04am UTC](https://www.ruby-forum.com/t/tips-for-debugging-fcgi/189290/1 "2010-05-28T05:04:47Z")

</div>

I found a easy way to debugging fcgi.  
easy\_install flup  
wget [http://gist.github.com/416675.txt](http://gist.github.com/416675.txt) -O debug\_fcgi.py  
chmod +x debug\_fcgi.py

# run using debug\_fcgi.py &

# remender to stop any other server running on port 9000 or change the

port number on debug\_fcgi.py.

# sample nginx configuration

```
location ~ ^(.+\.php)(.*)$ {
  fastcgi_pass 127.0.0.1:9000;
  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 N.  
+55 44 9918-8488
