|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #7741 [phpdoc] Document about every predefined variable
Submitted: 2000-11-10 04:32 UTC Modified: 2006-10-27 00:56 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: tictactux at surfeu dot ch Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.4.0 OS: Any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2000-11-10 04:32 UTC] tictactux at surfeu dot ch
This is not a bug but a change request:
Several people seem to struggle with .cgi and non-apache
servers, especially as server-supplied environment variables are used that are *not* defined in the current cgi/1.1 specifications (see
Only the following variables are defined there; everything else should be treated as 'vendor extensions':

Quote from
The canonical metavariables defined by this specification are: 


Therefore we should not rely on the presence of other variables; they might be used as a shortcut if present, however:

  My_script_filename = getenv("SCRIPT_FILENAME");
  if (!My_script_filename) {
     My_script_filename = mangle("PATH_INFO", "SCRIPT_NAME")

The mangle function does not really exist yet, right? ;-)

If we don't stick to a minimum, widely accept set of 'server properties', we get a lot of long, frustrated and finally red faces.
Always keep in mind that the Apache is not the only tribesman out there...

Regards, Ben


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-17 13:27 UTC]
IMHO available variables should not be limited,
but documented for each SAPI (with special
non-standard additions for CGI sapi)

re-classified as doc problem
 [2002-12-03 01:08 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

variables should now conform to CGI spec.
 [2002-12-03 01:19 UTC]
IMHO this is now a feature request to document all possible predefined variables, and should not be closed.  Each predefined variable should be documented in terms of when they'll be available.  For example, mod_rewrite makes a few available:

I thought this request was marked elsewhere but couldn't find it...  Am reopening for now, and changing summary.
 [2002-12-03 01:52 UTC]
google 'cgi variables' brings up tons of documentation, why waste time doing it yet again.  'document all possible predefined variables' will be a big job since there are a lot of those (outsided cgi spec), should just point to reference urls.  Anyway, the primary ones should now conform to cgi spec.

 [2006-10-27 00:56 UTC]
I think it is safe to say by now that this won't happen.  It's an infinite problem as any module can add new things to the server.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 26 04:03:33 2021 UTC