summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--php.ini-dist3
-rw-r--r--php.ini-recommended3
-rw-r--r--sapi/cgi/cgi_main.c7
3 files changed, 12 insertions, 1 deletions
diff --git a/php.ini-dist b/php.ini-dist
index 75af31cbd2..9ba5721cd2 100644
--- a/php.ini-dist
+++ b/php.ini-dist
@@ -481,6 +481,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 101eebb068..c5ad526bc5 100644
--- a/php.ini-recommended
+++ b/php.ini-recommended
@@ -539,6 +539,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 9cc8d220a5..a3394a6b66 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 */