|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69281 opcache_is_script_cached no longer works
Submitted: 2015-03-23 15:09 UTC Modified: 2015-04-01 20:12 UTC
From: Assigned: dmitry (profile)
Status: Closed Package: opcache
PHP Version: 5.6.7 OS: Centos
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:


 [2015-03-23 15:09 UTC]
The function opcache_is_script_cached is meant to return true if a script is already cached and present in OPCache. This is failing when running in the fpm-cgi in 5.6.7.

It works when:
* called from the CLI sapi.
* in the fpm-cgi sapi in 5.6.2

Test script:


//The current file should always be present, as it is compiled and cached before being run.

Expected result:
bool(true) bool(true)

Actual result:
bool(false) bool(false) 


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-24 05:43 UTC]
I can not reproduce this with php-fpm (5.6 branch)
 [2015-03-27 14:21 UTC]
It's possible I'm doing something dumb, but I've tested this against freshly compiled versions of 5.6.2 and 5.6.7 and there does seem to be different behaviour.

File /etc/php.ini




Configure script
./configure  \
                --bindir=/usr/bin \
                --sbindir=/usr/sbin \
                --sysconfdir=/etc \
                --localstatedir=/var \
                --with-config-file-path=/etc \
                --with-config-file-scan-dir=/etc/php.d \
                --disable-cgi \
                --disable-rpath \
                --enable-xmlreader \
                --enable-xmlwriter \
                --enable-apcu \
                --enable-fpm \
                --enable-intl \
                --enable-json \
                --enable-mbregex \
                --enable-mbstring \
                --enable-pcntl \
                --enable-pdo \
                --enable-sockets \
                --enable-sysvsem \
                --enable-sysvshm \
                --enable-zip \
                --with-bz2 \
                --with-curl \
                --with-freetype-dir=/usr/lib \
                --with-gd \
                --with-jpeg-dir=/usr/lib \
                --without-mcrypt \
                --with-png-dir=/usr/lib \
                --enable-fd-setsize=8192 \
                --with-pdo-mysql \
                --with-yaml \
                --with-zlib \
                --without-mhash \
                --with-mysql \
                --with-mysqli=mysqlnd \
                --with-openssl \
                --with-pcre-regex \
                --without-pear \

I'm using the builtin webserver to test `php -S` and then `wget -O php5.6.2.test` and the same command with a different output filename for 5.6.7 

I'm still seeing that the file is cached according to 5.6.2 and isn't according to 5.6.7
 [2015-03-27 15:03 UTC]
The bug is in two parts, first the timestamp is only set if the opcache.validate_timestamps is enabled:

But then OPCache is assuming that the file is only cached if the timestamp is set to not zero.
 [2015-04-01 20:12 UTC]
-Assigned To: +Assigned To: dmitry
 [2015-04-02 01:07 UTC]
Automatic comment on behalf of
Log: Fixed bug #69281 (opcache_is_script_cached no longer works)
 [2015-04-02 01:07 UTC]
-Status: Assigned +Status: Closed
 [2015-04-03 07:29 UTC]
Automatic comment on behalf of
Log: Fixed bug #69281 (opcache_is_script_cached no longer works)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 30 04:01:31 2024 UTC