|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #173 php_self with incorrect value/missing with command line
Submitted: 1998-03-14 20:57 UTC Modified: 1998-09-19 17:34 UTC
From: ars at ziplink dot net Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0 Latest CVS OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ars at ziplink dot net
New email:
PHP Version: OS:


 [1998-03-14 20:57 UTC] ars at ziplink dot net
php_self is returning the wrong value, with the cgi call:


php_self is:


instead of /g.php3, the pertiant web variables are:

      SCRIPT_NAME: '/cgi-bin/cgiwrap'
        PATH_INFO: '/ars/php/g.php3'
  PATH_TRANSLATED: '/www-pages/ars/php/g.php3'

Then cgiwrap changes them to:

      SCRIPT_NAME: '/cgi-bin/cgiwrap/ars/php'
        PATH_INFO: '/g.php3'
  PATH_TRANSLATED: '/www-pages/users/ars/cgi-bin/php'

php_self should IMO return a value that can be placed in
include or show_source, I could use PATH_INFO instead of
PHP_SELF but then it won't work if it get called from the
command line. Which brings up another point PHP_SELF isn't
set at all from the command line.

In addition I think a variable that contains the real path
to the php file would be useful, i.e. a path that can be
placed in fopen or passed with system(cat VALUE).

With all the means of calling php, apache, cgi w/o doc_root,
cgi with doc_root, #!php, and php <name> some standard value
would be of great benefit.

To summarize two values one for include or show_source, and
one for fopen or system(cat..) would be quite useful.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-09-19 17:34 UTC] rasmus
If you compile with --enable-force-cgi-redirect this bug should finally be fixed now (as of 3.0.4)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 07:01:30 2024 UTC