ZEND_DECLARE_MODULE_GLOBALS(phpdbg);
+static zend_bool phpdbg_booted = 0;
+
#if PHP_VERSION_ID >= 50500
void (*zend_execute_old)(zend_execute_data *execute_data TSRMLS_DC);
#else
if (php_module_startup(module, &sapi_phpdbg_module_entry, 1) == FAILURE) {
return FAILURE;
}
+
+ phpdbg_booted=1;
+
return SUCCESS;
} /* }}} */
static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */
{
- phpdbg_error("%s", message);
+ /*
+ * We must not request TSRM before being boot
+ */
+ if (phpdbg_booted) {
+ phpdbg_error("%s", message);
+ } else fprintf(stdout, "%s\n", message);
}
/* }}} */
}
phpdbg->ini_entries = ini_entries;
-
- if (phpdbg->startup(phpdbg) == SUCCESS) {
+ if (phpdbg->startup(phpdbg) == SUCCESS) {
+
zend_activate(TSRMLS_C);
/* do not install sigint handlers for remote consoles */