php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73554 undefined _GET
Submitted: 2016-11-17 13:06 UTC Modified: 2017-04-02 01:02 UTC
Votes:6
Avg. Score:4.7 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:2 (33.3%)
From: frank dot hartmann at netfira dot com Assigned: ab (profile)
Status: Duplicate Package: Apache2 related
PHP Version: 7.0.13 OS: Windows Server 2008 R2 64bit
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:
MUST BE VALID
Solve the problem:
45 - 42 = ?
Subscribe to this entry?

 
 [2016-11-17 13:06 UTC] frank dot hartmann at netfira dot com
Description:
------------
I am quite confident that I encounter the same problem as described in these two questions:
http://stackoverflow.com/questions/37463287/undefined-variable-get-after-a-period-of-time

http://stackoverflow.com/questions/36150812/undefined-variable-get/37448703#37448703

After some arbitrary time (at least a few hours) the $_GET-Variable in any script is suddenly not set anymore.
The only - and unacceptable - solution seems to be to restart Apache.

This is now happening on a development and production server with the following characteristics.

Dev: Windows Server 2008 R2 Datacenter 64bit,
Apache 2.4.23,
PHP 7.0.13

Prod: Windows Server 2008 R2 Datacenter 64bit,
Apache 2.4.4,
PHP 7.0.6

This is the codesnippet in a simple index.php
 
    <?php
    print_r($_POST);
    print_r($_GET);
    print_r($_REQUEST);
    print_r($HTTP_GET_VARS);
    echo "Hello World!";

Yielding the following Output in the browser by calling http://127.0.0.1/index.php?testGet=testValue:

>Array ( ) 
>
>Notice: Undefined variable: _GET in C:\Apache2.4\www\index.php on line 3
>
>Array ( [testGet] => testValue ) 
>
>Notice: Undefined variable: HTTP_GET_VARS in C:\Apache2.4\www\index.php on line 5
>
>Hello World!

The logs show no signs of any misbehavior and the processes respond (but slower than usual).


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-17 13:24 UTC] frank dot hartmann at netfira dot com
Note that $_REQUEST is set but $_GET is not and this happens under various versions of Apache and PHP
 [2016-11-18 12:16 UTC] p at dri dot com
I've been experiencing this on PHP 7.0.9 production, Windows 10 Pro and Windows 7 Pro (latest updates/SP for each). Thought I was going crazy or broke my setup, but glad to know it's not just me.

Seems to be after a random amount of time, but right after a slightly slower request to the server.
 [2016-12-05 08:29 UTC] php at rhickmott dot co dot uk
It's not just $_GET none of the superglobals seem to be set.

I have tried disabling Just in Time on superglobals to no avail. The higher the load on a server the worse the problem comes.
 [2017-03-21 19:42 UTC] mtanalin at yandex dot ru
I have the `undefined variable: _GET` issue using PHP 7.1.3 running via Apache 2.4.25 (ApacheLounge.com 32-bit build from 2017-01-27) under Windows 7 SP1 (64 bit).

I believe this issue is specific to PHP 7 since I never encountered it when used PHP 5.x.
 [2017-03-22 00:39 UTC] yohgaki@php.net
1. Could you disable opcache see what happens? i.e. Do not load opcache module.

2. Could you disable all modules see what happens? i.e. Do not load all modules.

2-1. If disabling all modules solves issue, could you identify which module is causing this?

3. Do you have the same issue with cli builtin server? i.e. php -S 127.0.0.1:8888 
If yes, disabling modules fixes issue or not?
 [2017-03-22 01:08 UTC] nikic@php.net
-Assigned To: +Assigned To: ab
 [2017-03-22 01:08 UTC] nikic@php.net
This sounds like another issue caused by non-atomic RCs under ZTS, in which case this should be fixed by the interning changes in master. Anatol, does this look familiar?
 [2017-03-22 21:57 UTC] ab@php.net
Yeah, this is pretty much the same issue that was fixed in master, quite many faced and shows in this report as broken auto globals. We've just finished the last week, but I had no time to go through the tickets to close. Will do soon'ish. In the meantime, if anyone of the voters could check the latest master builds, it would be great.

Thanks.
 [2017-03-29 12:20 UTC] ab@php.net
-Status: Assigned +Status: Closed
 [2017-03-29 12:20 UTC] ab@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2017-04-02 00:02 UTC] mtanalin at yandex dot ru
Looks like the bug is NOT fixed. I tested several snapshot builds so far, the latest tested one is 7.1.5-dev built on 2017-03-31 03:16:59 with MSVC14 (Visual C++ 2015) and with its distro represented as "php-7.1-ts-windows-vc14-x86-rdfb4875.zip" file.

Occasionally the `$_GET` variable gets undefined.
 [2017-04-02 01:02 UTC] ab@php.net
-Status: Closed +Status: Duplicate
 [2017-04-02 01:02 UTC] ab@php.net
Thanks for checking! My bad, I should have mentioned that it's master only. Please refer to bug #74185, marking this one as dup.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC