Skip to content

Commit 53eaead

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Disable ZEND_RC_MOD_CHECK() while loading shared extension in FPM
2 parents aa9d140 + 995f11a commit 53eaead

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sapi/fpm/fpm/fpm_php.c

+14
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,21 @@ int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */
9393
if (!strcmp(name, "extension") && *value) {
9494
zval zv;
9595
zend_interned_strings_switch_storage(0);
96+
97+
#if ZEND_RC_DEBUG
98+
bool orig_rc_debug = zend_rc_debug;
99+
/* Loading extensions after php_module_startup() breaks some invariants.
100+
* For instance, it will update the refcount of persistent strings,
101+
* which is normally not allowed at this stage. */
102+
zend_rc_debug = false;
103+
#endif
104+
96105
php_dl(value, MODULE_PERSISTENT, &zv, 1);
106+
107+
#if ZEND_RC_DEBUG
108+
zend_rc_debug = orig_rc_debug;
109+
#endif
110+
97111
zend_interned_strings_switch_storage(1);
98112
return Z_TYPE(zv) == IS_TRUE ? FPM_PHP_INI_EXTENSION_LOADED : FPM_PHP_INI_EXTENSION_FAILED;
99113
}

0 commit comments

Comments
 (0)