diff --git a/NEWS b/NEWS index cc1115238e6..d07b4a39d9d 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,10 @@ PHP NEWS - Fiber: . Fixed bug GH-11121 (ReflectionFiber segfault). (danog, trowski, bwoebi) +- FPM: + . Fixed bug GH-12232 (FPM: segfault dynamically loading extension without + opcache). (Jakub Zelenka) + - Opcache: . Added warning when JIT cannot be enabled. (danog) . Fixed bug GH-8143 (Crashes in zend_accel_inheritance_cache_find since diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index eaeb0adcec0..40bd38c163c 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -217,7 +217,6 @@ ZEND_API zend_result zend_register_ini_entries_ex(const zend_ini_entry_def *ini_ * lead to death. */ if (directives != EG(ini_directives)) { - ZEND_ASSERT(module_type == MODULE_TEMPORARY); directives = EG(ini_directives); } else { ZEND_ASSERT(module_type == MODULE_PERSISTENT); diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c index aadaafbb056..dd6bf9d9d5f 100644 --- a/sapi/fpm/fpm/fpm_php.c +++ b/sapi/fpm/fpm/fpm_php.c @@ -87,7 +87,9 @@ int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */ if (!strcmp(name, "extension") && *value) { zval zv; + zend_interned_strings_switch_storage(0); php_dl(value, MODULE_PERSISTENT, &zv, 1); + zend_interned_strings_switch_storage(1); return Z_TYPE(zv) == IS_TRUE; } diff --git a/sapi/fpm/tests/gh12232-php-value-extension.phpt b/sapi/fpm/tests/gh12232-php-value-extension.phpt new file mode 100644 index 00000000000..207bd7a6779 --- /dev/null +++ b/sapi/fpm/tests/gh12232-php-value-extension.phpt @@ -0,0 +1,51 @@ +--TEST-- +FPM: gh12232 - loading shared ext in FPM config +--SKIPIF-- + +--FILE-- +start(); +$tester->expectLogStartNotices(); +$tester->request()->expectBody(['bool(true)', 'string(5) "hello"', 'string(4) "test"']); +$tester->request()->expectBody(['bool(true)', 'string(5) "hello"', 'string(4) "test"']); +$tester->terminate(); +$tester->expectLogTerminatingNotices(); +$tester->close(); + +?> +Done +--EXPECT-- +Done +--CLEAN-- + +