-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix GH-8699: ini_get() opcache optimization in 8.1 #8997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: PHP-8.1
Are you sure you want to change the base?
Fix GH-8699: ini_get() opcache optimization in 8.1 #8997
Conversation
We only need to test this in cli, but this is a problem in ALL sapis that allow opcache optimizations. Issue: phpGH-8699
When using opcache with optimization return value from ini_get() for PHP_INI_SYSTEM type directives was cached per file. This is a problem for shared files that use ini_get(). This is a real problem for virtual hosts (both apache and fpm) because using php_admin_(value|flag) sets any value as PHP_INI_SYSTEM, and this really is the only way to set specific values per virtual host. Like changing the upload directory. Fixes phpGH-8699
I think it makes sense from the FPM PoV not to do this optimization because it can be changed using PHP_ADMIN_VALUE. @dstogov are you fine with this change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is a bug and if it should be fixed.
By design, ZEND_INI_SYSTEM
setting are set once during PHP startup and cannot be changed. Settings that may be changed per-request should be ZEND_INI_PERDIR
. FPM ignores this, but this doesn't mean overriding of all ZEND_INI_SYSTEM
will work.
@dstogov You are right in principle. However |
That said I would agree that it's not exactly a bug and I'd rather not change in the patch release. This slightly protects people that expose FPM to public network as we had bunch of reports about allowing anyone to set |
The proper solution would be adding |
Ok I think introducing new |
This fixes #8699 for PHP-8.1.
Can also be used for 8.0 and 7.4.
For 8.2, the problematic code has been moved to zend_optimizer.c.