ID: 25968
User updated by: bob at rsi dot com
Reported By: bob at rsi dot com
Status: Bogus
Bug Type: CGI related
Operating System: W2K Server - SP3
PHP Version: 4.3.3
New Comment:

The answer to this bug appears to be that IIS is not setting
REQUEST_URI in the environment for PHP under CGI mode.

The above comment about looking in php.ini for clues appears to be
incorrect guidance.

Better off to start reading here:
[url]http://php.net/reserved.variables[/url]
[url]http://hoohoo.ncsa.uiuc.edu/cgi/env.html[/url]
[url]http://php.net/manual/en/function.getenv.php[/url]
[url]http://php.net/manual/en/function.phpinfo.php[/url]
phpinfo(INFO_ENVIRONMENT);

And here is a code snippet work around:

// Work around REQUEST_URI bug under W2K/IIS/CGI/PHP
if (!isset($_SERVER['REQUEST_URI']) and isset($_SERVER['SCRIPT_NAME']))
{
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
if (isset($_SERVER['QUERY_STRING']) and
!empty($_SERVER['QUERY_STRING']))
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}


Previous Comments:
------------------------------------------------------------------------

[2003-10-30 20:47:39] [email]sniperphp.net[/email]

See the php.ini-dist for all the cgi. prefixed options
and tune those. This is not a bug.


------------------------------------------------------------------------

[2003-10-24 09:15:07] bob at rsi dot com

System = Windows NT 5.0 build 2195
Build Date = Aug 24 2003 22:01:16
Server API = CGI/FastCGI
PHP API = 20020918
PHP Extension = 20020429
Zend Extension = 20021010
Debug Build = no
Thread Safety = enabled

------------------------------------------------------------------------

[2003-10-23 22:13:19] [email]iliaaphp.net[/email]

What sapi are you using?

------------------------------------------------------------------------

[2003-10-23 10:43:35] bob at rsi dot com

Description:
------------
Somewhere between PHP4.2.3 and PHP 4.3.1 REQUEST_URI disappeared.



Reproduce code:
---------------
echo $_SERVER['REQUEST_URI'];


Expected result:
----------------
echo _SERVER['SCRIPT_NAME'] . '?' . _SERVER['QUERY_STRING'];


Actual result:
--------------
Notice: Undefined index: REQUEST_URI in ...



------------------------------------------------------------------------


--
Edit this bug report at [url]http://bugs.php.net/?id=25968&edit=1[/url]