Skip to content

ErrorException: Warning: Zend OPcache API is restricted by "restrict_api" configuration directive #34947

@hracik

Description

@hracik

Symfony version(s) affected: 4.4.1

Description
When opcache.restrict_api is set then symfony/http-kernel/Kernel.php (line 555) throws an exception ErrorException Warning: Zend OPcache API is restricted by "restrict_api" configuration directive.

Probably can be fixed same way as this #25985.

How to reproduce

$kernel = new Kernel($env, $debug);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);

Possible Solution

if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
  @opcache_invalidate($this->getPath(), true);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions