php.net |  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
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.
Password:
Status:
Package:
Bug Type:
Summary:
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:

http://www/cgi-bin/cgiwrap/ars/php/g.php3

php_self is:

/cgi-bin/cgiwrap/ars/php/g.php3

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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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: Sat Apr 20 06:01:28 2024 UTC