php.net |  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: cmb@php.net Assigned: dmitry (profile)
Status: Closed Package: opcache
PHP Version: 8.0.0-dev OS: All
Private report: No CVE-ID: None
 [2019-06-19 21:22 UTC] cmb@php.net
Description:
------------
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.



Patches

file-cache-fix.patch (last revision 2019-06-20 05:47 UTC by krakjoe@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

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

@@ -2342,6 +2360,7 @@ static void accel_activate(void)
 
 #ifdef HAVE_OPCACHE_FILE_CACHE
        if (file_cache_only) {
+               ZCG(accelerator_enabled) = 0;
                return;
        }
 #endif

extracted from diff of the two tags ...
 [2019-06-20 05:14 UTC] krakjoe@php.net
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] krakjoe@php.net
-Assigned To: +Assigned To: dmitry
 [2019-06-20 05:40 UTC] krakjoe@php.net
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] krakjoe@php.net
The following patch has been added/updated:

Patch Name: file-cache-fix.patch
Revision:   1561009651
URL:        https://bugs.php.net/patch-display.php?bug=78185&patch=file-cache-fix.patch&revision=1561009651
 [2019-06-20 05:48 UTC] krakjoe@php.net
I think the last patch (made against 7.4) looks more correct ...
 [2019-06-20 06:08 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=cd6a6e4cf2677bfbe2a21164239737eb22bd4da6
Log: Fixed bug #78185 (File cache no longer works)
 [2019-06-20 06:08 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 [2019-06-20 08:39 UTC] remi@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d51108d5df7868ec53257bcd7131886a52af1c1f
Log: Fixed bug #78185 (File cache no longer works)
 [2019-06-20 10:27 UTC] cmb@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=525c80ec74305f49545ee109f47fdfa495b24aee
Log: Fixed bug #78185 (File cache no longer works)
 [2019-06-21 05:18 UTC] krakjoe@php.net
-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] krakjoe@php.net
This is not fixed in master
 [2019-06-21 07:08 UTC] dmitry@php.net
-Status: Re-Opened +Status: Closed
 [2019-06-21 07:08 UTC] dmitry@php.net
Fixed. The master issue was related to JIT.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC