summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index bc157ec70e..84d2213cd6 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1532,7 +1532,7 @@ PHP_INI_END()
*/
static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals)
{
-#ifdef ZTS
+#if defined(ZTS) && defined(PHP_WIN32)
ZEND_TSRMLS_CACHE_UPDATE();
#endif
php_cgi_globals->rfc2616_headers = 0;
@@ -1793,7 +1793,9 @@ int main(int argc, char *argv[])
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
(void)ts_resource(0);
+# ifdef PHP_WIN32
ZEND_TSRMLS_CACHE_UPDATE();
+# endif
#endif
zend_signal_startup();