|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78184 Fatal error caused after ini_set opcache.enabled to 0 and require_once
Submitted: 2019-06-19 16:01 UTC Modified: 2019-06-19 16:07 UTC
From: rebsch at navigate-it-services dot de Assigned:
Status: Duplicate Package: opcache
PHP Version: 7.2.19 OS: Ubuntu 18.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
49 + 33 = ?
Subscribe to this entry?

 [2019-06-19 16:01 UTC] rebsch at navigate-it-services dot de
Setup: apache + fpm
2 Files: test.php and require.php placed in the Document Root

If a file that was cached in the opcache is required after disabling the opcache for the current request, php will produce a fatal error.

Using the code snippets below the bug can be triggered by calling the URI /test.php followed by calling the URI /test.php?opcache

PHP 7.2.17 does not show this behaviour.

Test script:
// test.php
ini_set('display_errors', 'on');

if (array_key_exists('opcache', $_GET)) {
        ini_set('opcache.enable', 0);

require_once($_SERVER['DOCUMENT_ROOT'] . '/require.php');

// require.php

Expected result:
output should always be:


Actual result:
when the bug is actually triggered the result is:

Fatal error: require_once(): Failed opening required '[...]/require.php' (include_path='.:/usr/share/php') in [...]/test.php on line 8


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-19 16:07 UTC]
-Status: Open +Status: Duplicate
 [2019-06-19 16:07 UTC]
Duplicate of bug #78106. This will be fixed in the next 7.2/7.3 versions.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 05:01:34 2024 UTC