php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75982 $_SERVER mostly empty with default variables_order GPCS on FastCGI/CGI
Submitted: 2018-02-20 05:52 UTC Modified: 2018-02-20 09:33 UTC
From: mattficken@php.net Assigned:
Status: Closed Package: *Configuration Issues
PHP Version: master-Git-2018-02-20 (snap) OS: Windows, any OS?
Private report: No CVE-ID: None
 [2018-02-20 05:52 UTC] mattficken@php.net
Description:
------------
When variables_order=GPCS(default), $_SERVER is only populated with PHP_SELF, REQUEST_TIME_FLOAT and REQUEST_TIME (PATH_TRANSLATED, etc... are missing).

MediaWiki is broken on master. MediaWiki depends on $_SERVER['PATH_TRANSLATED']. Other apps depend on this too. Drupal and Wordpress are not affected.

If variables_order is set to EGPCS then $_SERVER is populated as normal.

On 7.2, 7.1, 7.0, $_SERVER is populated when variables_order=GPCS or EGPCS, so $_SERVER is populated by default.

This this an intentional behavior change? Or a bug?



I am still investigating, but at this time I believe this is caused by this: http://git.php.net/?p=php-src.git;a=commitdiff;h=bdf77f02f637bc0efbb55a800be1860279cc5b3e


If this is an intentional behavior change, then http://php.net/manual/en/ini.core.php#ini.variables-order should be updated now or when PHP 7.3 is released (also should tell MediaWiki).



Test script:
---------------
Check phpinfo(); on web server.

Or var_dump($_SERVER) on web server.

This isn't a problem on CLI sapi. `php -i` includes $_SERVER 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-20 09:33 UTC] mike@php.net
Maybe related to bdf77f02f637bc0efbb55a800be1860279cc5b3e
 [2018-03-13 01:27 UTC] mattficken@php.net
Ping?
 [2018-03-23 12:17 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fe6f092e5e60eb165ed4b6db69416ffcdcbd54b7
Log: Fixed bug #75982 ($_SERVER mostly empty with default variables_order GPCS on FastCGI/CGI)
 [2018-03-23 12:17 UTC] dmitry@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 10:01:31 2024 UTC