summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sapi/cgi/cgi_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index de1be31c41..1c0b489f28 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1493,11 +1493,6 @@ static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_
*/
static PHP_MINIT_FUNCTION(cgi)
{
-#ifdef ZTS
- ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL);
-#else
- php_cgi_globals_ctor(&php_cgi_globals TSRMLS_CC);
-#endif
REGISTER_INI_ENTRIES();
return SUCCESS;
}
@@ -1801,6 +1796,12 @@ int main(int argc, char *argv[])
tsrm_ls = ts_resource(0);
#endif
+#ifdef ZTS
+ ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL);
+#else
+ php_cgi_globals_ctor(&php_cgi_globals TSRMLS_CC);
+#endif
+
sapi_startup(&cgi_sapi_module);
fastcgi = fcgi_is_fastcgi();
cgi_sapi_module.php_ini_path_override = NULL;