|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78185 File cache no longer works
Submitted: 2019-06-19 21:22 UTC Modified: 2019-06-21 07:08 UTC
From: Assigned: dmitry (profile)
Status: Closed Package: opcache
PHP Version: 8.0.0-dev OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2019-06-19 21:22 UTC]
If I enable opcache.file_cache_only, phpinfo reports that the file
cache is enabled, but no cache files are created. This worked with
PHP 7.3.7RC1, but no longer with 7.3.7RC2.

I have not checked PHP 7.2.20RC2, but it is likely affected as well.


file-cache-fix.patch (last revision 2019-06-20 05:47 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-19 21:41 UTC]
-PHP Version: 7.3.7RC1 +PHP Version: 7.3.7RC2
 [2019-06-20 04:52 UTC]
This looks highly suspect:

@@ -2342,6 +2360,7 @@ static void accel_activate(void)
        if (file_cache_only) {
+               ZCG(accelerator_enabled) = 0;

extracted from diff of the two tags ...
 [2019-06-20 05:14 UTC]
Try this (patch probably won't apply on 7.3 branch) ...

diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 85e0de94dd..52eab0d775 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2315,7 +2315,7 @@ int accel_activate(INIT_FUNC_ARGS)
        ZCG(cwd_check) = 1;
        if (file_cache_only) {
-               ZCG(accelerator_enabled) = 0;
+               ZCG(accelerator_enabled) = 1;
                return SUCCESS;

I'm pretty sure that's the problem ...
 [2019-06-20 05:40 UTC]
-Assigned To: +Assigned To: dmitry
 [2019-06-20 05:40 UTC]
I don't fully understand why that seems to fix it, and don't understand why reverting the original change doesn't seem to fix it.

Assigning to dmitry ...
 [2019-06-20 05:47 UTC]
The following patch has been added/updated:

Patch Name: file-cache-fix.patch
Revision:   1561009651
 [2019-06-20 05:48 UTC]
I think the last patch (made against 7.4) looks more correct ...
 [2019-06-20 06:08 UTC]
Automatic comment on behalf of
Log: Fixed bug #78185 (File cache no longer works)
 [2019-06-20 06:08 UTC]
-Status: Assigned +Status: Closed
 [2019-06-20 08:39 UTC]
Automatic comment on behalf of
Log: Fixed bug #78185 (File cache no longer works)
 [2019-06-20 10:27 UTC]
Automatic comment on behalf of
Log: Fixed bug #78185 (File cache no longer works)
 [2019-06-21 05:18 UTC]
-Status: Closed +Status: Re-Opened -Operating System: Windows +Operating System: All -PHP Version: 7.3.7RC2 +PHP Version: 8.0.0-dev
 [2019-06-21 05:18 UTC]
This is not fixed in master
 [2019-06-21 07:08 UTC]
-Status: Re-Opened +Status: Closed
 [2019-06-21 07:08 UTC]
Fixed. The master issue was related to JIT.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 03:03:42 2022 UTC