php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22116 PHP_SELF gives wrong info
Submitted: 2003-02-07 16:33 UTC Modified: 2003-02-20 08:10 UTC
From: russ at iris dot washington dot edu Assigned:
Status: No Feedback Package: Variables related
PHP Version: 4.3.0 OS: Solaris 2.7 sparc
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
41 - 7 = ?
Subscribe to this entry?

 
 [2003-02-07 16:33 UTC] russ at iris dot washington dot edu
I was able to use this workaround:
    $_SERVER['SCRIPT_NAME'] =
    substr($_SERVER['PATH_TRANSLATED'],
       strlen($_SERVER['DOCUMENT_ROOT']));
    if (substr($_SERVER['SCRIPT_NAME'], 0, 2) == '//') {
       $_SERVER['SCRIPT_NAME'] =
            substr($_SERVER['SCRIPT_NAME'], 1);
    }
to fix an invalid PHP_SELF on Solaris 2.7
Sparc, PHP 4.3.0 .

Simply doing phpinfo(); and then appending the value of
PHP_SELF onto an 'ls ' statement yielded "no such file".

The file did not exist:

$ ls /~russ/tryseed/showSeed.phtml
/~russ/tryseed/showSeed.phtml: No such file or directory

The clue here is this: I was running out
of a "pubic_html" subdirectory off of ~russ (see above).
The URL typed into IE 5.2 (Mac OS X) was:

"http://hostname/~russ/tryseed/showSeed.html"

** I have other pages on same web server, same PHP which
are hosted out of the server's normal root directory
and they don't have this problem. **

--Thank you to whoever came up with that workaround above.
I just put similar text as a COMMENT on a CLOSED linux 
Bug #21261.  This needs to be considered OPEN AFAIK.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-20 08:10 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 05:01:28 2024 UTC