Bug #78184 [NEW]: Fatal error caused after ini_set opcache.enabled to 0 and require_once
From: rebsch at navigate-it-services dot de
Operating system: Ubuntu 18.04
PHP version: 7.2.19
Package: opcache
Bug Type: Bug
Bug description:Fatal error caused after ini_set opcache.enabled to 0 and require_once
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
--
Edit bug report at https://bugs.php.net/bug.php?id=78184&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78184&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78184&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78184&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78184&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78184&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78184&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78184&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78184&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78184&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78184&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78184&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78184&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78184&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78184&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78184&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78184&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78184&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78184&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78184&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78184&r=mysqlcfg
Thread (2 messages)
- rebsch at navigate-it-services dot de