# Double logging via PHP FastCGI on Windows XP?

**URL:** <https://www.ruby-forum.com/t/double-logging-via-php-fastcgi-on-windows-xp/163925>\
**Category:** NGINX\
**Created:** [March 26, 2009, 6:28am UTC](https://www.ruby-forum.com/t/double-logging-via-php-fastcgi-on-windows-xp/163925 "2009-03-26T06:28:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Dascalescu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Dan\_Dascalescu](https://www.ruby-forum.com/u/Dan_Dascalescu)\
**Post date:** [March 26, 2009, 6:28am UTC](https://www.ruby-forum.com/t/double-logging-via-php-fastcgi-on-windows-xp/163925/1 "2009-03-26T06:28:35Z")

</div>

In a PHP script, I have this statement:

```
error_log("||here goes an error_log error||");

```

When I request the script from the web server, the nginx error log  
shows the message twice:

2009/03/25 20:49:19 [error] 4380#0: \*1 FastCGI sent in stderr: “||here  
goes an error\_log error||  
||here goes an error\_log error||” while reading response header from  
upstream, client: 127.0.0.1, server: localhost, request: “POST  
/script.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9123”, host:  
“127.0.0.1”

Does anyone know what’s happening here? I’m not sure if the error is  
with php-cgi.exe, or with nginx.

My nginx.conf is adapted from [http://wiki.nginx.org/PHPFastCGIOnWindows:](http://wiki.nginx.org/PHPFastCGIOnWindows:)

worker\_processes 1;  
error\_log logs/error.log notice;  
events {  
worker\_connections 64;  
}

http {  
include mime.types;  
default\_type application/octet-stream;  
sendfile on;  
keepalive\_timeout 65;

```
server {
    listen 80;
    server_name localhost;

    location / {
        root ../www;
        index index.html index.htm;
        autoindex on;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root html;
    }

    # pass the PHP scripts to FastCGI server listening on 

```

127.0.0.1:9000  
location ~ .php$ {  
fastcgi\_pass 127.0.0.1:9123;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_FILENAME c:/www$fastcgi\_script\_name;  
include fastcgi\_params;  
}

```
}

```

}

---

<div class="post-metadata">

**Author:** ![Dan\_Dascalescu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ce7236/32.png) [@Dan\_Dascalescu](https://www.ruby-forum.com/u/Dan_Dascalescu)\
**Post date:** [March 26, 2009, 8:12am UTC](https://www.ruby-forum.com/t/double-logging-via-php-fastcgi-on-windows-xp/163925/2 "2009-03-26T08:12:39Z")

</div>

On Wed, Mar 25, 2009 at 08:56:16PM -0700, Dan Dascalescu wrote:

> upstream, client: 127.0.0.1, server: localhost, request: “POST  
> /script.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9123”, host:  
> “127.0.0.1”
> 
> Does anyone know what’s happening here? I’m not sure if the error is  
> with php-cgi.exe, or with nginx.

The simple way to test it is to run nginx on Unix host. It seems there  
were  
no these issues on Unix installations.
