OPCache can be temporarily disabled by adding the following code to the script−
ini_set('opcache.enable', 0);
This can be used to determine if OPCache is the cause of the script failure. Therefore, users do not have to check every extension and turn them on/off to see which extension is causing the problem.
Find the log showing which file and the reason behind the script failed (when OPCache is enabled).
This is a viable option if the user has more information about the application they are trying to debug.
ini_set('display_errors', 1); error_reporting(~0);
If the above two solutions do not work, users can use Xdebug to debug their applications. It has a remote debugger that allows users to view the data structures used by the application and helps interactively step through the code as well as debug it.
The above is the detailed content of How to debug and log PHP OPcache issues. For more information, please follow other related articles on the PHP Chinese website!