Bug #70357 [Opn]: OPcache status is unavailable in shutdown

From: Date: Fri, 04 Sep 2015 18:35:14 +0000
Subject: Bug #70357 [Opn]: OPcache status is unavailable in shutdown
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195769@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70357&edit=1

 ID:                 70357
 User updated by:    viktor at szepe dot net
 Reported by:        viktor at szepe dot net
 Summary:            OPcache status is unavailable in shutdown
 Status:             Open
 Type:               Bug
 Package:            opcache
 Operating System:   Debian 8.1
 PHP Version:        7.0.0RC1
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[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.

------------------------------------------------------------------------
[2015-08-26 07:02:19] viktor at szepe dot net

Maybe the current path changes in shutdown??

------------------------------------------------------------------------
[2015-08-26 06:59:24] viktor at szepe dot net

Docs says:

If opcache.restrict_api is in use and the current path is in violation of the rule, an E_WARNING
will be raised; no status information will be returned. 

Does '/home/wp/website/html/opcache-status-in-shutdown.php' violate
"/home/wp/website/" ?

------------------------------------------------------------------------
[2015-08-26 06:58:12] viktor at szepe dot net

It is very strange: after disabling opcache.restrict_api it is OK.
But opcache.restrict_api was "/home/wp/website/" and the only script is:

  'scripts' => 
  array (
    '/home/wp/website/html/opcache-status-in-shutdown.php' => 
    array (
      'full_path' => '/home/wp/website/html/opcache-status-in-shutdown.php',
      'hits' => 0,
      'memory_consumption' => 1288,
      'last_used' => 'Wed Aug 26 08:54:46 2015',
      'last_used_timestamp' => 1440572086,
      'timestamp' => 0,
    ),

How should I use opcache.restrict_api to get OPcache status?

------------------------------------------------------------------------


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


Thread (12 messages)

« previous php.bugs (#195769) next »