Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Opcache reset
  • PHP 5.5 introduced "OpCache by default".

    I found a problem which (I think) is rather fuel related.

    opcache_reset();

    return \Response::redirect('admin/opcache/');
    OR
    header('Location: admin/opcache/');
    exit;

    When I run this code, opcache stucks in restart_pending state. If I remove the redirection, it works. If I run the above code in a simple php file, rewritting the redirect to header, it works.

    I am stucked.
  • I can't reproduce that here, it redirects just fine?

    Note that as with any opcache, you can run into severe problems when you alter files that are already in the cache, APC has the same issue. In general, only enable an opcode cache in production.
  • The redirection is OK. The opcache stucks in restart_pending state.

    And only if I redirect.
  • How do you detect that?
  • I checked the C++ source, the pending flag is reset even before the cache is actually restarted. The restart is triggered from accel_activate(), which is called when is script is being compiled.

    Does your config actually compile anything? If not, it will remain in a pending state, because accel_activate() will never be called.

    With the default config, even if enabled, it doesn't compile anything.
  • Here is my controller:

    http://bin.fuelphp.com/~tG


    I found an ugly way to make it work: put a redirect to shutdown event.

    And I've just realized that opcache_invalidate also does not work

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion