diff options
author | Tiago Natel de Moura <t.nateldemoura@f5.com> | 2020-02-25 15:55:31 +0000 |
---|---|---|
committer | Tiago Natel de Moura <t.nateldemoura@f5.com> | 2020-02-25 15:55:31 +0000 |
commit | 98c0ce6cc413b174d5a36f92095246a9967b1371 (patch) | |
tree | 3c177c08624e5709171a6d432a9a534875c273b8 | |
parent | f519e31e2d97492d85aee13451554527540ccd90 (diff) | |
download | unit-98c0ce6cc413b174d5a36f92095246a9967b1371.tar.gz unit-98c0ce6cc413b174d5a36f92095246a9967b1371.tar.bz2 |
PHP: fixed php >= 7.4 with zts enabled.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_php_sapi.c | 30 |
1 files changed, 17 insertions, 13 deletions
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 <nxt_unit_request.h> -#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) |