logging through the fastcgi connection
; 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
; 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
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 */