php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38476 PATH_INFO, ORIG_PATH_INFO, and PHP_SELF not set in Lighttpd1.4.11/PHP4.4.3
Submitted: 2006-08-16 20:09 UTC Modified: 2007-07-10 01:00 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: fietka at rpi dot edu Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 4.4.3 OS: Debian Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fietka at rpi dot edu
New email:
PHP Version: OS:

 

 [2006-08-16 20:09 UTC] fietka at rpi dot edu
Description:
------------
In the course of playing with my new Lighty server running on Debian, I ran into a problem with the PHP_SELF, PATH_INFO, and ORIG_PATH_INFO variables - specifically, Lighty doesn't provide them to my PHP install.

Even after applying all the fixes I could find:

Adding "broken-scriptfilename" => "enable" to my PHP config in lighttpd.conf

Set cgi.fix_pathinfo = 1 in /etc/php4/cgi/php.ini

Compiled PHP4 with ./configure --enable-fastcgi --enable-ftp --with-mysql --enable-force-redirect --enable-discard-path

Various combinations of these fixes didn't work either (PHP compiled with and without each/both of the cgi-related switches). I found a workaround for the KnowledgeTree? DMS: http://issues.ktdms.com/browse/KTS-1289 and a Google Answers post I made generated some good kludges(though neither of them work): http://google.com/answers/threadview?id=754764

This seems to be a fairly serious Lighty/PHP issue that affects a large number of people and currently has no resolution. If anyone wants any further information or wants to contribute ideas on how to fix this, feel free to e-mail me. 

Reproduce code:
---------------
print $_SERVER["PATH_INFO"];
print $_SERVER["PHP_SELF"];
print $_SERVER["ORIG_PATH_INFO"];

Expected result:
----------------
null
null
null

Actual result:
--------------
Given site.com/folder/script.php,
/folder
/folder/script.php
/folder

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-16 23:15 UTC] tony2001@php.net
Duplicate of bug #31892.
 [2006-08-16 23:38 UTC] fietka at rpi dot edu
Actually, bug 31892 is slightly different (only 1 of the 3 variables I'm missing is missing in that bug). Also, the solutions, diffs, and patches cited in that bug are long outdated, making that report irrelevant.
 [2006-08-17 11:45 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-08-17 12:44 UTC] fietka at rpi dot edu
I'll try to give that  try on a development machine,but as far as I know, installing PHP5 will break most, if not all, of my PHP applications. Is this actually a PHP4 bug?
 [2006-08-17 13:37 UTC] fietka at rpi dot edu
Okay - upgrading to the latest 5.2 from CVS populated PHP_SELF correctly, with ORIG_PATH_INFO and PATH_INFO still empty. I did notice that php.ini with php5 no longer has the cgi.fix_pathinfo option available - why is that?
 [2007-05-27 18:06 UTC] sniper@php.net
I added the missing entries into HEAD/PHP_5_2 branches php.ini-* files.
 [2007-07-02 23:18 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

There have been some fixes to this. Please try it out.
And FYI: PHP 4 is being phased out, meaning, there won't be any support whatsoever for it soon.
 [2007-07-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 05 00:01:29 2024 UTC