Edit report at https://bugs.php.net/bug.php?id=70357&edit=1
ID: 70357
Updated by: cmb@php.net
Reported by: viktor at szepe dot net
Summary: OPcache status is unavailable in shutdown
-Status: Feedback
+Status: Open
-Type: Bug
+Type: Documentation Problem
Package: opcache
Operating System: Debian 8.1
PHP Version: 7.0.0RC1
-Assigned To: cmb
+Assigned To:
Block user comment: N
Private report: N
New Comment:
Ah, FPM. I can't help with that, but want to point out that this
issue is related to SG(request_info).path_translated[1] which is
apparently changed during shutdown.
Given that it behaves this way for many years now, I think it's
best to document the issue.
[1] <https://github.com/php/php-src/blob/php-7.4.21/ext/opcache/zend_accelerator_module.c#L91-L96>
Previous Comments:
------------------------------------------------------------------------
[2021-07-13 17:05:12] viktor at szepe dot net
Thank you!
PHP 7.4 FPM works the same way. In shutdown function opcache.restrict_api makes opcache_get_status
return false.
I should live with it.
I leave all this up to you!
------------------------------------------------------------------------
[2021-07-13 14:59:09] cmb@php.net
I cannot reproduce this with PHP-7.4 (apache2handler on Windows).
So either the issue has been resolved in the meantime, or there is
some relevant difference in our setups. Do you still experience
this issue with any of the actively supported PHP versions[1]?
Which SAPI are you using?
[1] <https://www.php.net/supported-versions.php>
------------------------------------------------------------------------
[2015-09-04 18:35:13] viktor at szepe dot net
I think opcache.restrict_api is not interested in cwd but the path of the queried PHP script.
Before 7.0 I was able to get OPcache status in shutdown.
------------------------------------------------------------------------
[2015-09-04 16:28:12] kalle@php.net
From register_shutdown_function():
Note:
Working directory of the script can change inside the shutdown function under some web servers,
e.g. Apache.
Not sure what we can do about that as this sort of behavior have always been like it around other
places of PHP
------------------------------------------------------------------------
[2015-08-26 07:05:34] viktor at szepe dot net
Yes. getcwd() returns "/" in shutdown.
Even setting opcache.restrict_api to "/" does not help.
Please advise.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=70357
--
Edit this bug report at https://bugs.php.net/bug.php?id=70357&edit=1