Zend OPcache问题(Windows Server 2012 + IIS + Plesk + PHP 7)

时间:2016-03-10 05:07:35

标签: php iis plesk opcache

我刚刚升级到PHP 7并且发现它很好而且很快,但是自从我升级(代码完全不变)以来我一直在间歇性地发生内部服务器错误(500)。我记录了错误,普通日志中没有任何内容,但在事件查看器中,我有数以千计的这些:

The description for Event ID 487 from source Zend OPcache cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

Base address marks unusable memory region. Please setup opcache.file_cache and opcache.file_cache_callback directives for more convenient Opcache usage
Attempt to access invalid address.

我假设我已经错误配置了某些内容,或者某些内容随着更新而消失。任何帮助都会非常棒,非常感谢。

4 个答案:

答案 0 :(得分:8)

我需要添加/更改我的php.ini以包含以下内容。我在一个关于“Moodle”的网站上找到了它......不管是什么。

我希望它对那里的一些人有用!

opcache.enable=1
zend_extension="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP70\ext\php_opcache.dll"

opcache.memory_consumption = 128
opcache.max_accelerated_files = 4000
opcache.revalidate_freq = 60

; Required for Moodle
opcache.use_cwd = 1
opcache.validate_timestamps = 1
opcache.save_comments = 1
opcache.enable_file_override = 0
opcache.revalidate_path = 1 ; May fix problems with include paths
opcache.mmap_base = 0x20000000 ; (Windows only) fix OPcache crashes with event id 487

答案 1 :(得分:1)

还有https://bugs.php.net/bug.php?id=72645

可以通过为其他版本的PHP(5.4,5.5,5.6)禁用opcache或为每个IIS站点切换专用池来解决此问题。

答案 2 :(得分:0)

我已使用opcache.enable_cli = 0修复了the same problem OroCRM软件。

答案 3 :(得分:0)

opcache.file_cache="C:\Windows\temp\php_opcache"
opcache.file_cache_fallback=1

用于参考和设置操作缓存:https://www.php.net/manual/en/opcache.installation.php