Double logging via PHP FastCGI on Windows XP?

Dan Dascalescu ddascalescu+nginx at
Thu Mar 26 06:56:16 MSK 2009

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:, server: localhost, request: "POST
/script.php HTTP/1.1", upstream: "fastcgi://", host:

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

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
        location ~ \.php$ {
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  c:/www$fastcgi_script_name;
            include        fastcgi_params;


More information about the nginx mailing list