From 926ec431235d72561f9c62e952a3352a94b0a55c Mon Sep 17 00:00:00 2001 From: foobar Date: Thu, 28 Apr 2005 13:14:55 +0000 Subject: [PATCH] MFH --- php.ini-dist | 3 +++ php.ini-recommended | 3 +++ sapi/cgi/cgi_main.c | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/php.ini-dist b/php.ini-dist index fbc60b9dd0..5ff6edde36 100644 --- a/php.ini-dist +++ b/php.ini-dist @@ -477,6 +477,9 @@ enable_dl = On ; Set to 1 if running under IIS. Default is zero. ; fastcgi.impersonate = 1; +; Disable logging through FastCGI connection +; fastcgi.log = 0 + ; cgi.rfc2616_headers configuration option tells PHP what type of headers to ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that ; is supported by Apache. When this option is set to 1 PHP will send diff --git a/php.ini-recommended b/php.ini-recommended index 216d3b8ae2..df75d75b9c 100644 --- a/php.ini-recommended +++ b/php.ini-recommended @@ -535,6 +535,9 @@ enable_dl = On ; Set to 1 if running under IIS. Default is zero. ; fastcgi.impersonate = 1; +; Disable logging through FastCGI connection +; fastcgi.log = 0 + ; cgi.rfc2616_headers configuration option tells PHP what type of headers to ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that ; is supported by Apache. When this option is set to 1 PHP will send diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index f06ac1a643..be0faa0f69 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -482,9 +482,14 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) static void sapi_cgi_log_message(char *message) { #if PHP_FASTCGI + int logging = 1; TSRMLS_FETCH(); - if (!FCGX_IsCGI()) { + if (cfg_get_long("fastcgi.logging", &logging) == FAILURE) { + logging = 1; + } + + if (!FCGX_IsCGI() && logging) { FCGX_Request *request = (FCGX_Request *)SG(server_context); FCGX_FPrintF( request->err, "%s\n", message ); /* ignore return code */ -- 2.40.0