php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61045
Patch bug61045-5.4.patch revision 2012-05-05 15:53 UTC by fat@php.net
Patch bug61045-5.3.patch revision 2012-05-05 15:53 UTC by fat@php.net
Patch patch-5.3.10-error_log revision 2012-03-04 18:16 UTC by ewgraf at gmail dot com

Patch patch-5.3.10-error_log for FPM related Bug #61045

Patch version 2012-03-04 18:16 UTC

Return to Bug #61045 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: ewgraf@gmail.com

--- sapi/fpm/fpm/fpm_main.c.orig	2012-03-04 23:26:08.941459365 +0600
+++ sapi/fpm/fpm/fpm_main.c	2012-03-05 00:03:16.852506974 +0600
@@ -656,7 +656,23 @@
 	TSRMLS_FETCH();
 
 	if (CGIG(fcgi_logging)) {
-		zlog(ZLOG_NOTICE, "PHP message: %s", message);
+		if (!fpm_global_config.error_log) {
+			fcgi_request *request;
+			request = (fcgi_request*) SG(server_context);
+			
+			if (request) {
+				int len = strlen(message);
+				char *buf = malloc(len+2);
+				memcpy(buf, message, len);
+				memcpy(buf + len, "\n", sizeof("\n"));
+				fcgi_write(request, FCGI_STDERR, buf, len+1);
+				free(buf);
+			} else {
+				zlog(ZLOG_NOTICE, "PHP message: %s", message);
+			}
+		} else {
+			zlog(ZLOG_NOTICE, "PHP message: %s", message);
+		}
 	}
 }
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 21:01:28 2024 UTC