php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24329 Appending path info to a php script breaks under IIS
Submitted: 2003-06-25 06:13 UTC Modified: 2003-08-18 11:28 UTC
From: marcus at quintic dot co dot uk Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.3.2 OS: XP and 2k
Private report: No CVE-ID: None
 [2003-06-25 06:13 UTC] marcus at quintic dot co dot uk
Description:
------------
I have a page, test.php, that contains simply a call to phpinfo(). If I go to it in a browser as http://localhost/test.php it displays the php information as expected. If I attach some path_info to the url I get a cannot find page error under IIS5.1 on XP and a PHP error saying it cant find the test.php/whatever/I/have/here script.

Clearly this is wrong. I have searched the bug tracking database and the following suggestions have been tried in both ISAPI and CGI mode (none of them work for us, although the bugs are getting closed presumably because they work for the people trying them):

cgi.force_redirect = 0 (I've also tried 1)
cgi.fix_pathinfo = 0 (I've also tried 1)

Setting the IIS AllowPathInfo... variable to TRUE or FALSE makes no difference. I've also tried all combinations of the above. This isnt a one off either as it happens on all machines we've tried it on (5 separate IIS5 installations so far).

The strange thing is, IIS looks like its requesting the correct document, test.php because thats whats coming up in the IIS logs - it looks like php is returning the error. On the 2k box this is more obvious because we get an error from php saying that it cant open a stream on c:/inetpub/wwwroot/whatever/I/have/here when IIS is allowing PATH_INFO and c:/inetpub/wwwroot/test.php/whatever/I/have/here when IIS does not allow PATH_INFO.




Reproduce code:
---------------
// IIS5.1, PHP 4.3.x 
// Goto URL http://localhost/test.php/path/info

<?php phpinfo(); ?>

Expected result:
----------------
I'd expect the test.php document to be displayed whether I entered path information or not.

Note that this is not a bug about PATH_INFO being incorrect - we dont even get that far. PHP returns errors about not being able to open a stream to a document that _includes_ the path_info in its translated path. It also happens under ISAPI or CGI.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-25 06:14 UTC] marcus at quintic dot co dot uk
The first para should read:

.... If I attach some path_info to the url I get a cannot find page error under IIS5.1 on XP and under 2k a PHP error saying it cant find the test.php/whatever/I/have/here script.
 [2003-08-14 00:35 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

And check your php.ini settings. (this works fine for me in Linux/Apache)

 [2003-08-18 09:41 UTC] marcus at quintic dot co dot uk
This does not appear to fix it under the limited tests I've tried. I'll add more feedback when I can perform more testing.
 [2003-08-18 11:06 UTC] sniper@php.net
It's just some configure setting you have wrong. Works fine for me.

 [2003-08-18 11:28 UTC] abies@php.net
This is a IIS issue, not a PHP issue. MS has limited the number of path sections in a URL in a pathetic attempt to increase IIS security. Same limitation applies to ISAPI DLLs. (eg. isapli.dll/path1/path2)
Passing only path1 will work fine.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 07:01:29 2024 UTC