Extend opcache check if it is enabled (#3664)
Credit to @vosco88. When trying to deploy October on shared hosting (www.websupport.sk) it is possible to receive the following error when accessing the frontend pages - ErrorException:> Zend OPcache API is restricted by "restrict_api" configuration directive. This checks not only if the opcache_invalidate exists but also if opcache is enabled. Same check is actually present in twig vendor files - but so far it is working without having the check there.
This commit is contained in:
parent
9c2bb8469e
commit
2d1a904512
|
|
@ -334,7 +334,7 @@ class CodeParser
|
|||
* Compile cached file into bytecode cache
|
||||
*/
|
||||
if (Config::get('cms.forceBytecodeInvalidation', false)) {
|
||||
if (function_exists('opcache_invalidate')) {
|
||||
if (function_exists('opcache_invalidate') && ini_get('opcache.enable')) {
|
||||
opcache_invalidate($path, true);
|
||||
}
|
||||
elseif (function_exists('apc_compile_file')) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue