php.net |  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
 [2019-06-19 16:01 UTC] rebsch at navigate-it-services dot de
Description:
------------
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
echo('success');

Expected result:
----------------
output should always be:

success

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-19 16:07 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2019-06-19 16:07 UTC] nikic@php.net
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: Sun Oct 06 17:01:27 2024 UTC