Double logging via PHP FastCGI on Windows XP?


#1

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:

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;
}

}

}


#2

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.