I am using WAMP on Windows 10, running PHP 7.2 with Apache 2.4
When I am turning on OPcache, a page I am loading crashes with the following error in Chrome:
ERR_CONNECTION_RESET
I checked the php error log and Apache error log and could not find any error reported. I tried to disable Xdebug, still same crash and no errors in the logs. Turning off OPcache or switching to php 7.1 or below resolves the issue.
I was looking everywhere for some information on how to debug what causes OPcache to fail (and the reason) as turning it off is not a solution, but couldn't find anything helpful (also checked similar SO questions like this one which also has no resolution), so I am reaching out to the experts here for assistance, which I am sure will also help others.
Thank you.
P.S. Note that after a very long manual trial and error I was able to find the file in my php application that was causing OPcache to fail/crash and blacklisted that file in OPcache php.ini configuration (also reducing its size worked fine, so I doubt the problem was the actual code inside), but I am still looking for an easy way to debug such issues without having to go through & check each file on a server. I also don't know why it fails, so finding the cause for the failure will help file bug reports to the OPcache developers.
EDIT: Adding a pastebin link requires code to be added to the question. Here is the beginning of the pastebin file:
<?php
global $_LANGADM;
$_LANGADM = array();
$_LANGADM['AdminAddressesd3b206d196cd6be3a2764c1fb90b200f'] = 'Delete selected';
$_LANGADM['AdminAddressese25f0ecd41211b01c83e5fec41df4fe7'] = 'Delete selected items?';
TL;DR
I am looking for:
1) A way to easily determine that OPcache is the extension that makes a script fail, without having to go through each extension with a manual trial and error (turn them on/off until finding the extension that fails).
2) Easily find a way/log that shows which file and the reason/s it fails when OPcache is enabled.
In simplest words - how can we know when, where and why OPcache fails when it fails, as without any reports/logs it's like searching for a needle in a haystack, especially when even Xdebug seems to be not logging or outputing anything when OPcache fails, for some reason.
Thanks again