|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12475 the variable $PHP_SELF is not set.
Submitted: 2001-07-30 21:12 UTC Modified: 2002-05-14 14:33 UTC
From: remco at panviva dot com Assigned:
Status: Closed Package: Variables related
PHP Version: 4.0.6 OS: Windows 2000 Server
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: remco at panviva dot com
New email:
PHP Version: OS:


 [2001-07-30 21:12 UTC] remco at panviva dot com
if I open a script containing only the phpinfo() function, the $PHP_SELF field is not filled in. In my own scripts it's not setted at all.

I'm using the zipped version of php4.06 with cgi wrapper using xitami 2.4d6 running as a windows service.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-15 17:35 UTC]
Was able to verify this.  Anyone able to provide any information about why this occurs?
 [2001-12-24 10:06 UTC]
Can you try 4.1.0 or even 4.1.1 (when it's out) or the latest CVS (
 [2002-01-14 02:07 UTC]
No feedback, closing.
 [2002-02-23 12:00 UTC] jeff11 at gondon dot net
Hi. I also have this Problem, even with the newest version of PHP (4.1.1, using the *.msi file). I'm using Xitami, but I can't be that, because when using PHP3, all works well.

Is there a fix?
 [2002-05-14 07:27 UTC] oliver dot vesper at ollinux dot de
I had the same problem using PHP 4.1.2 and still have the problem using 4.2.1. Platform is Linux and Apache 1.3.24.
 [2002-05-14 07:30 UTC] oliver dot vesper at ollinux dot de
but you can use $_SERVER['PHP_SELF'] to access PHP_SELF. maybe $PHP_SELF doesn't exist anymore?!
 [2002-05-14 14:33 UTC]
Typically register_globals = on is what creates $PHP_SELF.  register_globals affects many variables, SERVER ones too. 

If you really want $PHP_SELF to exist then try:

if (!ini_get('register_globals')) {

This may or may not be a solution to the original bug report, but is regarding Oliver's and perhaps Jeff's.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 19 03:03:37 2021 UTC