php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15690 $PHP_SELF empty
Submitted: 2002-02-23 12:07 UTC Modified: 2002-07-28 01:00 UTC
Votes:22
Avg. Score:4.3 ± 1.0
Reproduced:17 of 19 (89.5%)
Same Version:6 (35.3%)
Same OS:7 (41.2%)
From: beat-x at gmx dot net Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4.1.1 OS: Windows 2000
Private report: No CVE-ID: None
 [2002-02-23 12:07 UTC] beat-x at gmx dot net
Using PHP 4.1.1. (I downloaded the *.msi package) and Xitami 2.4d9 on Windows 2000. $PHP_SELF seems not to be set. phpinfo() gives me an empty field, in scripts it is not set at all. When I use PHP3 everything is okay. Who can I fix this? Does it work with the ZIP-file (but it's 4 MB, phew, I'm a modem user)? Anybody got a solution?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-24 08:53 UTC] cseiler at cyberspace dot org
I've got a workaround for this problem, that seems to work perfectly:

1. Create a file somewhere, e.g. c:\self_fix.php
2. Insert to following content:
     <?php $PHP_SELF = ereg_replace("/$","",$SERVER_URL).$SCRIPT_NAME; ?>
   (This will create a 'new' variable $PHP_SELF by pasting $SERVER_URL
   and $SCRIPT_NAME together)
3. Close and save the file. Now open your php.ini (probabely located
   in your C:\Windows-directoy).
4. Add the following lines to the [php] section:
     auto_prepend_file = c:\self_fix.php
     register_globals = on
   (These will prepend the file created above to every PHP-file called
   by the interpreter. The second line makes $PHP_SELF globally available.)
 [2002-03-18 06:42 UTC] marcel dot lorette at freeworld dot be
I have the same problem.
I use PHP 4.1.2 with Xitami 2.4d9 on windows ME. If I use apache 1.3.23 instead of Xitami, everything is all right...
 [2002-04-26 05:45 UTC] bugphp at rawurl dot nl
For me it's a 2 year problem.
It means that I'm used to it, but I had always a persistent internet connection.

I use Apache 1.3.24 with PHP 4.2.0
and still the same problem 
Windows 98 and windows 2000

Charlie
 [2002-06-27 20:30 UTC] sniper@php.net
Do you have register_globals=On in your php.ini?

 [2002-07-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-09-29 10:38 UTC] wolfgang at umsu dot de
I'm experiencing the same problem since I updated to 4.2.3 (CGI version, Xitami, win98). register_globals is on. (When I turn it off, $PHP_SELF is not even listed in phpinfo(), when I turn it on, it is listed but empty.)

thanks to cseiler@cyberspace.org for the workaround: It works.
 [2002-10-01 20:04 UTC] dagringo at gmx dot net
I just upgraded from php 4.0.something to 4.2.3 and experience your problem (which i never heard of before) I'm running NT5, apache 1.3 and php 4.2.3
the problems as said occured after the upgrade (the apache staid the same).
 [2002-10-25 16:51 UTC] dpatte at relativedata dot com
i have php 4.0.6 
i am running windows ME
i have xitami 2.4d9

i see the same thing - php_self is empty.

register_globals is on, but 
note that HTTP_SERVER_VARS("PHP_SELF") is also empty!
 [2002-10-29 07:00 UTC] cosmicslug at yahoo dot com
Sorry to say 'me too' but hey! Me too!
Setup - Win2K, no service packs. Basic PHP 4.2.3 installed. Register globals is "On".

Tried latest versions of Xitami & Apache, but phpinfo() on both servers (suggesting its a workstation problem) shows $PHP_SELF and $_SERVER['PHP_SELF'] as empty.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC