|  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
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: fietka at rpi dot edu
New email:
PHP Version: OS:


 [2006-08-16 20:09 UTC] fietka at rpi dot edu
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: and a Google Answers post I made generated some good kludges(though neither of them work):

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"];

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-16 23:15 UTC]
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]
Please try using this CVS snapshot:
For Windows:

 [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]
I added the missing entries into HEAD/PHP_5_2 branches php.ini-* files.
 [2007-07-02 23:18 UTC]
Please try using this CVS snapshot:
For Windows (zip):

For Windows (installer):

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: Thu Feb 22 02:01:29 2024 UTC