Skip to content

Commit 65fce7f

Browse files
committed
Fixed bug #55541 errors spawn MessageBox, which blocks test automation
With that, also fixed bug #68297 (Application Popup provides too few information) as a better error message is provided to the event log. In the second case, the condition for display_startup_error was removed. The condition was added as a fix for bug #30760 which was preventing the MessageBox to appear. When display_startup_error=on, the error will be seen on the console. But when running under a webserver it'll probably get lost, so we need to log it other way into the event log (would be done automatically when message box was used, but that would eventually cause issues of blocked execution). Generally speaking - any MessageBox or other graphical element is a potential issue and that was repeatedly reported. Graphical elements shouldn't be used in the core. Even being a rare one it can cause a bad situation where the server is blocked. Yet some places have to cleaned up.
1 parent 4d743ee commit 65fce7f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Zend/zend_ini_parser.y

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
#include "zend_ini_scanner.h"
3030
#include "zend_extensions.h"
3131

32+
#ifdef PHP_WIN32
33+
#include "win32/syslog.h"
34+
#endif
35+
3236
#define YYERROR_VERBOSE
3337
#define YYSTYPE zval
3438

@@ -179,10 +183,9 @@ static void ini_error(char *msg)
179183

180184
if (CG(ini_parser_unbuffered_errors)) {
181185
#ifdef PHP_WIN32
182-
MessageBox(NULL, error_buf, "PHP Error", MB_OK|MB_TOPMOST|0x00200000L);
183-
#else
184-
fprintf(stderr, "PHP: %s", error_buf);
186+
syslog(LOG_ALERT, "PHP: %s (%s)", error_buf, GetCommandLine());
185187
#endif
188+
fprintf(stderr, "PHP: %s", error_buf);
186189
} else {
187190
zend_error(E_WARNING, "%s", error_buf);
188191
}

main/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,8 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
10661066
if (!module_initialized || PG(log_errors)) {
10671067
char *log_buffer;
10681068
#ifdef PHP_WIN32
1069-
if ((type == E_CORE_ERROR || type == E_CORE_WARNING) && PG(display_startup_errors)) {
1070-
MessageBox(NULL, buffer, error_type_str, MB_OK|ZEND_SERVICE_MB_STYLE);
1069+
if (type == E_CORE_ERROR || type == E_CORE_WARNING) {
1070+
syslog(LOG_ALERT, "PHP %s: %s (%s)", error_type_str, buffer, GetCommandLine());
10711071
}
10721072
#endif
10731073
spprintf(&log_buffer, 0, "PHP %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno);

0 commit comments

Comments
 (0)