close
Skip to content

PHP Warning: Zend OPcache API is restricted by "restrict_api" #733

@raamdev

Description

@raamdev

In some scenarios src/includes/closures/Shared/SysUtils.php#L85 may throw the following warning:

PHP Warning: Zend OPcache API is restricted by "restrict_api" configuration directive in /www/wp-content/plugins/comet-cache/src/includes/closures/Shared/SysUtils.php on line 85

This is most likely the result of stringent rules put in place with opcache.restrict_api. So while functionIsPossible('opcache_get_status') on the previous line, the actual call to opcache_get_status() fails with a Warning.

I recommend that we suppress these warnings with @:

    if (!is_array($status = @opcache_get_status(false)) || !$status) {
        return ($status = false);
    }

Referencing: https://wordpress.org/support/topic/zend-opcache-api-is-restricted

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions