php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch file-cache-fix.patch for opcache Bug #78185

Patch version 2019-06-20 05:47 UTC

Return to Bug #78185 | Download this patch
Patch Revisions:

Developer: krakjoe@php.net

diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 85e0de94dd..0b6617feb4 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -1888,7 +1888,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
 	int key_length;
 	int from_shared_memory; /* if the script we've got is stored in SHM */
 
-	if (!file_handle->filename || !ZCG(accelerator_enabled)) {
+	if (!file_handle->filename || (!ZCG(accelerator_enabled) && !file_cache_only)) {
 		/* The Accelerator is disabled, act as if without the Accelerator */
 		ZCG(cache_opline) = NULL;
 		ZCG(cache_persistent_script) = NULL;
@@ -2315,7 +2315,6 @@ int accel_activate(INIT_FUNC_ARGS)
 	ZCG(cwd_check) = 1;
 
 	if (file_cache_only) {
-		ZCG(accelerator_enabled) = 0;
 		return SUCCESS;
 	}
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 10:01:28 2024 UTC