# Nginx Doesn't Log FastCGI Errors

**URL:** <https://www.ruby-forum.com/t/nginx-doesnt-log-fastcgi-errors/218328>\
**Category:** NGINX\
**Created:** [March 28, 2012, 1:53pm UTC](https://www.ruby-forum.com/t/nginx-doesnt-log-fastcgi-errors/218328 "2012-03-28T13:53:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 28, 2012, 1:53pm UTC](https://www.ruby-forum.com/t/nginx-doesnt-log-fastcgi-errors/218328/1 "2012-03-28T13:53:12Z")

</div>

I have recently migrated my Nginx+PHP-FPM server from a Centos 5 to a  
Centos 6 server and I basically migrated the whole configuration from  
the old server to the new one with minor changes. I compiled the newest  
versions of Nginx (1.0.14) and PHP (5.3.10), Centos 5 had 1.0.2 and  
5.3.2.

The problem is that Nginx doesn’t log FastCGI errors in its error.log,  
it’s logging it’s own errors without a problem. I’m talking about the  
errors which look like this:

“2012/03/28 07:56:01 [error] 14919#0: \*697095886 FastCGI sent in stderr:  
“CSRF state token does not match one provided” while reading response  
header from upstream…”

I tried to change many things, but I can’t make the FastCGI errors to be  
logged in the Nginx error.log.

nginx.conf: [nginx.conf - Pastebin.com](http://pastebin.com/ABMm0c5h)  
php-fpm.conf: [php-fpm.conf - Pastebin.com](http://pastebin.com/kFuztqXN)  
php.ini loggin section: [php.ini logging section - Pastebin.com](http://pastebin.com/bVWdTgCi)

Posted at Nginx Forum:

> **[Nginx Doesn't Log FastCGI Errors](https://forum.nginx.org/read.php?2,224536,224536#msg-224536)**
>
> I have recently migrated my Nginx+PHP-FPM server from a Centos 5 to a Centos 6 server and I basically migrated the whole configuration from the old server to the new one with minor changes. I compiled the newest versions of Nginx (1.0.14) and PHP...

---

<div class="post-metadata">

**Author:** ![kustodian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b782af/32.png) [@kustodian](https://www.ruby-forum.com/u/kustodian)\
**Post date:** [March 28, 2012, 2:06pm UTC](https://www.ruby-forum.com/t/nginx-doesnt-log-fastcgi-errors/218328/2 "2012-03-28T14:06:50Z")

</div>

Hello!

On Wed, Mar 28, 2012 at 07:52:37AM -0400, kustodian wrote:

> “2012/03/28 07:56:01 [error] 14919#0: \*697095886 FastCGI sent in stderr:  
> “CSRF state token does not match one provided” while reading response  
> header from upstream…”
> 
> I tried to change many things, but I can’t make the FastCGI errors to be  
> logged in the Nginx error.log.
> 
> nginx.conf: [nginx.conf - Pastebin.com](http://pastebin.com/ABMm0c5h)  
> php-fpm.conf: [php-fpm.conf - Pastebin.com](http://pastebin.com/kFuztqXN)  
> php.ini loggin section: [php.ini logging section - Pastebin.com](http://pastebin.com/bVWdTgCi)

This is php regression, see here:

> **[PHP :: Bug #61045 :: fpm don't send error log to fastcgi clients(nginx)](https://bugs.php.net/bug.php?id=61045)**

There are also reports that

```
catch_workers_output = yes

```

in php-fpm config should help, see here (in Russian):

[http://mailman.nginx.org/pipermail/nginx-ru/2012-March/046217.html](http://mailman.nginx.org/pipermail/nginx-ru/2012-March/046217.html)

Maxim D.

---

<div class="post-metadata">

**Author:** ![kustodian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b782af/32.png) [@kustodian](https://www.ruby-forum.com/u/kustodian)\
**Post date:** [March 28, 2012, 3:56pm UTC](https://www.ruby-forum.com/t/nginx-doesnt-log-fastcgi-errors/218328/3 "2012-03-28T15:56:54Z")

</div>

Thank you very much for the reply. I was trying everything, I searched  
everywhere and I couldn’t find the solution.

Just to note for others, setting “catch\_workers\_output = yes” doesn’t  
work, you can either patch php with a fix provided in the bug  
[PHP :: Bug #61045 :: fpm don't send error log to fastcgi clients(nginx)](https://bugs.php.net/bug.php?id=61045), or use PHP 5.3.8, which I would  
recommend since the patch didn’t come from the official PHP developer.

Posted at Nginx Forum:

> **[Re: Nginx Doesn't Log FastCGI Errors](https://forum.nginx.org/read.php?2,224536,224554#msg-224554)**
>
> I have recently migrated my Nginx+PHP-FPM server from a Centos 5 to a Centos 6 server and I basically migrated the whole configuration from the old server to the new one with minor changes. I compiled the newest versions of Nginx (1.0.14) and PHP...
