2

I've just upgraded to PHP 7 and finding it nice and quick, but I've been getting intermittent Internal Server Error (500)'s since I upgraded (with completely unchanged code). I'm logging errors and nothing comes up in the normal log, but in event viewer, I've got thousands of these:

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.

I'm assuming either I've misconfigured something, or something has gone with the update. Any help would be absolutely fantastic and greatly appreciated.

2
  • Have you had any luck figuring this error out? I'm getting the same. Commented Mar 25, 2016 at 15:41
  • @Rocket04 Ah yes, it was my PHP.ini configuration. As I run it on a windows server the default configuration is completely wrong. I'll post the config that works in a moment. Commented Mar 26, 2016 at 23:30

3 Answers 3

12

I needed to add / change my php.ini to include the following. I found it on a website about "Moodle"... whatever that is.

I hope it's useful to some people out there!

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
Sign up to request clarification or add additional context in comments.

2 Comments

Just as an FYI, be sure to check what your actual PHP configuration is before blindly using the values above. In most cases the defaults should be fine, it's only the opcach.mmap_base value which should be needed to resolve the crashes. Also see the ZendOptimizerPlus issue #167 for more detail on the issue if you're still seeing problems.
FYI Moodle is a learning management system. Used to deliver online courses to students...
1

There is also https://bugs.php.net/bug.php?id=72645

Which can be workaround by disabling opcache for other version of PHP(5.4, 5.5, 5.6) or switching dedicated pools for each IIS site.

3 Comments

Please elaborate your suggestion a bit. We are using opcache on all our PHP 5.6 sites without issues, as far as I know.
@FrancDrobnič There is a know issue that OpCache and Wincache can't work for different PHP versions on IIS sites which use same IIS Application Pool. If you have dedicated pools for each site - there should be everything OK.
Well, luckily, besides dedicated pools for each site we are indeed using ApplicationPoolIdentity as suggested by Microsoft and so, according to the thorough eplanation that user ab gave in the bug track, we are safe from this bug. Thank you for the explanation.
0
opcache.file_cache="C:\Windows\temp\php_opcache"
opcache.file_cache_fallback=1

Use for reference and setup opcache :https://www.php.net/manual/en/opcache.installation.php

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.