Bug #68869 [Opn]: Require and Include Files with Variables Doesn't Update Global Value on Refresh
| From: | own3mall at gmail dot com | Date: | Wed, 21 Jan 2015 06:38:45 +0000 |
| Subject: | Bug #68869 [Opn]: Require and Include Files with Variables Doesn't Update Global Value on Refresh | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-190099@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68869&edit=1
ID: 68869
User updated by: own3mall at gmail dot com
Reported by: own3mall at gmail dot com
Summary: Require and Include Files with Variables Doesn't
Update Global Value on Refresh
Status: Open
Type: Bug
Package: Streams related
Operating System: Ubuntu 14.04
PHP Version: 5.6.4
Block user comment: N
Private report: N
New Comment:
OK, well that's strange. That appears to work...
But I wasn't even using opcache. It was commented out which I would assume means it was
disabled? I guess not...
Maybe the settings you sent me should be the defaults?
Previous Comments:
------------------------------------------------------------------------
[2015-01-21 05:09:18] rasmus@php.net
Try uncommenting these entries and setting them like this:
opcache.validate_timestamps=1
opcache.revalidate_freq=0
and restart apache, of course.
------------------------------------------------------------------------
[2015-01-21 04:55:35] own3mall at gmail dot com
Which settings are you specifically interested in? My /etc/apache2/apache2.conf looks like this:
http://pastebin.com/xWLweR55
My php.ini:
http://pastebin.com/6ghRdN6P
------------------------------------------------------------------------
[2015-01-21 04:20:12] requinix@php.net
What are your opcache settings?
------------------------------------------------------------------------
[2015-01-21 03:49:46] own3mall at gmail dot com
Description:
------------
Basically, if a redirect is sent such as header("Location: page.php"); to the client or
the page is refreshed by the client, a variable being loaded through a require statement does not
always update in the global scope. The global variable's value is set to the old value even
though the file the variable is loaded from has changed. The old value remains until the page is
refreshed again after a wait period.
I was able to reproduce this issue on PHP 5.5.9 and PHP 5.6.4.
Here's a video which explains and shows what is going on:
https://www.youtube.com/watch?v=xVLMdgnXfww&feature=youtu.be
The source to the script shown in the video can be downloaded here:
http://dinofly.com/files/linux/bugs/php5.5.x_refresh_bug.tar.gz
I was not able to reproduce this issue on a php 5.3.x virtual machine running Ubuntu 12.04.
Basically, I'm not sure when this bug was introduced, but I know it doesn't happen on
older versions of php.
Test script:
---------------
http://dinofly.com/files/linux/bugs/php5.5.x_refresh_bug.tar.gz
Expected result:
----------------
Global variable value should be updated on each page refresh or load to what is defined in the file
that is required.
Actual result:
--------------
Global variable sometimes updates correctly when the page is refreshed but other times is not if
refreshed quickly. It needs to be consistent.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68869&edit=1