php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21919 wrong PHP superglobalname in apache environment
Submitted: 2003-01-28 07:03 UTC Modified: 2003-01-28 12:48 UTC
From: tolga at kadikoy-bld dot gov dot tr Assigned:
Status: Not a bug Package: Apache related
PHP Version: 4.3.0 OS: AIX 4.3.3
Private report: No CVE-ID: None
 [2003-01-28 07:03 UTC] tolga at kadikoy-bld dot gov dot tr
Hello,
Apache version : IBM_HTTP_Server/1.3.12.3 Apache/1.3.12 
OS             : AIX 4.3.3 Maintenance Level 10 applied
I'm trying build a cookie based session system but an interesting problem occurs.When i use setcookie() function, it sends cookie to browser (and browser stores it) but i don't use cookie with $cookievariable.After a little inspection ( :) ) i found this result :
--------------
Apache env. superglobal name   : value
HTTP_COOK0E                    : mytestcookie=mytestval
HTTP_CONNECT0ON                : Keep-Alive  
--------------
it seems wrong superglobal names here (I -> zero)
if i use echo "$HTTP_COOK0E";   it works fine but if i use $HTTP_COOKIE not work.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-28 07:05 UTC] tolga at kadikoy-bld dot gov dot tr
of course i'm using register_globals = On
 [2003-01-28 07:46 UTC] m dot ford at lmu dot ac dot uk
This looks to be related to (or even duplicate of) #21771.
 [2003-01-28 08:05 UTC] tolga at kadikoy-bld dot gov dot tr
additional info for sniper's request;
i checked    var_dump($_SERVER)  and
only these vars mangled :
HTTP_ACCEPT_ENCOD0NG
HTTP_CONNECT0ON
HTTP_COOK0E

other vars (such as SCRIPT_FILENAME , SERVER_ADMIN) fine...

i use that script  :   
----------------------
<? var_dump($_SERVER); ?>
----------------------

and script's output :
----------------------
array(30) { ["DOCUMENT_ROOT"]=> string(28) "/usr/HTTPServer/htdocs/en_US" ["HTTP_ACCEPT"]=> string(164) "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" ["HTTP_ACCEPT_ENCOD0NG"]=> string(13) "gzip, deflate" ["HTTP_ACCEPT_LANGUAGE"]=> string(2) "tr" ["HTTP_CONNECT0ON"]=> string(10) "Keep-Alive" ["HTTP_COOK0E"]=> string(74) "4images_lastvisit=1043070424; 4images_userid=1; seysin=hoIIo; seyIIn=hoIIo" ["HTTP_HOST"]=> string(22) "www.kadikoy-bld.gov.tr" ["HTTP_USER_AGENT"]=> string(69) "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)" ["HTTPS"]=> string(3) "OFF" ["PATH"]=> string(51) "/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin" ["REMOTE_ADDR"]=> string(12) "172.22.1.250" ["REMOTE_PORT"]=> string(4) "2779" ["SCRIPT_FILENAME"]=> string(40) "/usr/HTTPServer/htdocs/en_US/sniper1.php" ["SERVER_ADDR"]=> string(14) "195.155.224.19" ["SERVER_ADMIN"]=> string(24) "tolga@kadikoy-bld.gov.tr" ["SERVER_NAME"]=> string(22) "www.kadikoy-bld.gov.tr" ["SERVER_PORT"]=> string(2) "80" ["SERVER_SIGNATURE"]=> string(0) "" ["SERVER_SOFTWARE"]=> string(45) "IBM_HTTP_Server/1.3.12.3 Apache/1.3.12 (Unix)" ["UNIQUE_ID"]=> string(19) "PjaKrsOb4BMAAIkMcL4" ["GATEWAY_INTERFACE"]=> string(7) "CGI/1.1" ["SERVER_PROTOCOL"]=> string(8) "HTTP/1.1" ["REQUEST_METHOD"]=> string(3) "GET" ["QUERY_STRING"]=> string(0) "" ["REQUEST_URI"]=> string(12) "/sniper1.php" ["SCRIPT_NAME"]=> string(12) "/sniper1.php" ["PATH_TRANSLATED"]=> string(40) "/usr/HTTPServer/htdocs/en_US/sniper1.php" ["PHP_SELF"]=> string(12) "/sniper1.php" ["argv"]=> array(0) { } ["argc"]=> int(0) }
--------------------------
 [2003-01-28 10:41 UTC] iliaa@php.net
What locale are you using, is it tr_TR?
 [2003-01-28 12:39 UTC] michael dot mauch at gmx dot de
@ Ilia: probably he is using tr_TR. I can see that problem if I set and export LC_ALL=tr_TR before starting Apache (1.3.27). If I do this, Apache starts to complain:

Invalid command 'MIMEMagicFile', perhaps mis-spelled or defined by a module not included in the server configuration

so I commented this line in the httpd.conf.

So there might be a problem in Apache. I get the same strange results with a little Perl script (/cgi-bin/test.pl, I think it comes with Apache):

print "Content-type: text/html\n\n";
print "%ENV: <br>\n", map { "$_ = $ENV{$_} <br>\n" } keys %ENV;

This script also prints HTTP_CONNECT&#304;ON and so on (this is with mod_perl; the test.cgi shell script works ok).

@Tolga: can you please try and put the following lines into your apachectl:

unset LC_ALL
LC_CTYPE=C
export LC_CTYPE

You might get other problems with these settings, unless you use setlocale(LC_CTYPE,"tr_TR") in your PHP scripts, though.
 [2003-01-28 12:48 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

It does indeed look like a locale problem and not something PHP related.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC