From 98c0ce6cc413b174d5a36f92095246a9967b1371 Mon Sep 17 00:00:00 2001 From: Tiago Natel de Moura Date: Tue, 25 Feb 2020 15:55:31 +0000 Subject: PHP: fixed php >= 7.4 with zts enabled. --- src/nxt_php_sapi.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/nxt_php_sapi.c') diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c index 26bf915f..917bc1c9 100644 --- a/src/nxt_php_sapi.c +++ b/src/nxt_php_sapi.c @@ -15,21 +15,19 @@ #include -#if PHP_MAJOR_VERSION >= 7 -# define NXT_PHP7 1 -# if PHP_MINOR_VERSION >= 1 -# define NXT_HAVE_PHP_LOG_MESSAGE_WITH_SYSLOG_TYPE 1 -# else -# define NXT_HAVE_PHP_INTERRUPTS 1 -# endif -# define NXT_HAVE_PHP_IGNORE_CWD 1 +#if PHP_VERSION_ID >= 50400 +#define NXT_HAVE_PHP_IGNORE_CWD 1 +#endif + +#if PHP_VERSION_ID >= 70100 +#define NXT_HAVE_PHP_LOG_MESSAGE_WITH_SYSLOG_TYPE 1 #else -# define NXT_HAVE_PHP_INTERRUPTS 1 -# if PHP_MINOR_VERSION >= 4 -# define NXT_HAVE_PHP_IGNORE_CWD 1 -# endif +#define NXT_HAVE_PHP_INTERRUPTS 1 #endif +#if PHP_VERSION_ID >= 70000 +#define NXT_PHP7 1 +#endif typedef struct nxt_php_run_ctx_s nxt_php_run_ctx_t; @@ -172,7 +170,7 @@ NXT_EXPORT nxt_app_module_t nxt_app_module = { static nxt_task_t *nxt_php_task; -#ifdef ZTS +#if defined(ZTS) && PHP_VERSION_ID < 70400 static void ***tsrm_ls; #endif @@ -278,10 +276,16 @@ nxt_php_init(nxt_task_t *task, nxt_common_app_conf_t *conf) } #ifdef ZTS + +#if PHP_VERSION_ID >= 70400 + php_tsrm_startup(); +#else tsrm_startup(1, 1, 0, NULL); tsrm_ls = ts_resource(0); #endif +#endif + #if defined(NXT_PHP7) && defined(ZEND_SIGNALS) #if (NXT_ZEND_SIGNAL_STARTUP) -- cgit