Skip to content
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

opcache_enabled automatically turns false #225

Open
shivamdixit opened this issue May 24, 2016 · 2 comments
Open

opcache_enabled automatically turns false #225

shivamdixit opened this issue May 24, 2016 · 2 comments

Comments

@shivamdixit
Copy link

shivamdixit commented May 24, 2016

I've the following OPCode configuration in php.ini:

opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=40000
opcache.validate_timestamps=1
opcache.revalidate_freq=10
opcache.fast_shutdown=1
opcache.enable_file_override=1
opcache.inherited_hack=1
opcache.dups_fix=1

On one of the servers when I call opcache_reset() function (through php-fpm), it sometimes returns me false and the key opcache_enabled (from opcache_get_status function) is false too. It automatically becomes true after some time and then the function works. Is this behaviour expected?

Before:

array(7) {
  ["opcache_enabled"]=>
  bool(true)
  ["cache_full"]=>
  bool(true)
  ["restart_pending"]=>
  bool(false)
  ["restart_in_progress"]=>
  bool(false)
  ["memory_usage"]=>
  array(4) {
    ["used_memory"]=>
    int(268435424)
    ["free_memory"]=>
    int(32)
    ["wasted_memory"]=>
    int(0)
    ["current_wasted_percentage"]=>
    float(0)
  }
....
}

-------> Calls opcache_reset(), gets true:

Now the status is:

array(7) {
  ["opcache_enabled"]=>
  bool(true)
  ["cache_full"]=>
  bool(true)
  ["restart_pending"]=>
  bool(true)
  ["restart_in_progress"]=>
  bool(false)
  ["memory_usage"]=>
  array(4) {
    ["used_memory"]=>
    int(268435424)
    ["free_memory"]=>
    int(32)
    ["wasted_memory"]=>
    int(0)
    ["current_wasted_percentage"]=>
    float(0)
  }
 ...
}

(Notice the restart_pending flag is on now, which is expected)

Now if I call the opcache_reset() at this point in time, it returns me false with opcache_enabled also as false. What am I missing out? Same thing works fine on other servers.

@viniciusss
Copy link

I have the same issue using apache.

@kristian-b
Copy link

The same issue I face of all of our Windows IIS/PHP 7.2 servers. Any solution available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants