【问题标题】:Zend OPcache Issue (Windows Server 2012 + IIS + Plesk + PHP 7)Zend OPcache 问题(Windows Server 2012 + IIS + Plesk + PHP 7)
【发布时间】:2016-06-24 19:09:16
【问题描述】:

我刚刚升级到 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.

我假设我配置错误,或者更新出现了问题。任何帮助都将非常棒,非常感谢。

【问题讨论】:

  • 你有没有运气找出这个错误?我也一样。
  • @Rocket04 是的,这是我的 PHP.ini 配置。当我在 Windows 服务器上运行它时,默认配置是完全错误的。稍后我将发布有效的配置。

标签: php iis plesk opcache


【解决方案1】:

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

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

【讨论】:

  • 请详细说明您的建议。据我所知,我们在所有 PHP 5.6 网站上都使用 opcache,没有任何问题。
  • @FrancDrobnič 有一个已知问题是 OpCache 和 Wincache 不能用于使用 same IIS 应用程序池的 IIS 站点上的不同 PHP 版本。如果每个站点都有专用池 - 应该一切正常。
  • 好吧,幸运的是,除了每个站点的专用池之外,我们确实按照 Microsoft 的建议使用了 ApplicationPoolIdentity,因此,根据用户 ab 在错误跟踪中给出的详尽说明,我们可以安全地避免这个错误。谢谢你的解释。
【解决方案2】:

我需要添加/更改我的 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

【讨论】:

  • 仅供参考,在盲目使用上述值之前,请务必检查您的实际 PHP 配置。在大多数情况下,默认值应该没问题,解决崩溃只需要opcach.mmap_base 值。如果您仍然遇到问题,请参阅 the ZendOptimizerPlus issue #167 了解有关该问题的更多详细信息。
  • 仅供参考 Moodle 是一个学习管理系统。用于向学生提供在线课程...
【解决方案3】:

我为 OroCRM 软件修复了 the same problem 和 opcache.enable_cli = 0。

【讨论】:

    【解决方案4】:
    opcache.file_cache="C:\Windows\temp\php_opcache"
    opcache.file_cache_fallback=1
    

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

    【讨论】:

      猜你喜欢
      • 2014-02-05
      • 2017-04-23
      • 2018-03-10
      • 1970-01-01
      • 2016-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多