#25172 [Bgs]: register_globals=on and $HTTP_HOST sometimes empty

From: Date: Sat, 04 Oct 2003 04:56:04 +0000
Subject: #25172 [Bgs]: register_globals=on and $HTTP_HOST sometimes empty
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-48555@lists.php.net to get a copy of this message
 ID:               25172
 Updated by:       sniper@php.net
 Reported By:      php at lansco dot de
 Status:           Bogus
 Bug Type:         Apache2 related
 Operating System: Linux
 PHP Version:      4.3.3
 New Comment:

..


Previous Comments:
------------------------------------------------------------------------

[2003-10-04 00:49:37] sniper@php.net

See bug #25753 (placeholder for all these reports about leaking php ini
settings)


------------------------------------------------------------------------

[2003-08-26 06:16:40] php at lansco dot de

I've found one (among thousands) .htaccess-File that contains "php_flag
register_globals off".

When I access the site that has this entry simultaneous with my test
page the error occurs. Elsewise not.

After I have disabled the .htaccess-entry the error doesn't occur any
more.

I have tested again various versions of PHP while accessing the site
with .htaccess-entry:

PHP-4.3.1: no errors
PHP-4.3.2: errors
PHP-4.3.3: errors

Why does it properly work with PHP-4.3.1 and not with later versions?

------------------------------------------------------------------------

[2003-08-25 22:24:08] sniper@php.net

Yes, it took about 30 minutes until I got the same result.
This is what I found:
register_globals Off On

Something caused this..are you ABSOLUTELY sure you don't use ANY
"php_value" or "php_admin_value" or "php_flag" or
"php_admin_flag"
directives in httpd.conf / .htaccess files?
(In ANY virtual host you might have there)



------------------------------------------------------------------------

[2003-08-25 05:08:34] php at lansco dot de

I have tested it right now with this command line:

# watch -n 1 "wget http://www.lansco.de/php/bug-25172.php -q -O
xxx;cat
xxx>>zzz;tail -n 30 zzz"

For about 10 minutes no error occured. After that time in nearly every
request I have had this error for about 30 times.

I added the line

  if(!isset($HTTP_HOST)) phpinfo();

to http://www.lansco.de/php/bug-25172.php and
there is a really
surprising phenomenon:
In the phpinfo()-output HTTP_HOST is correctly set to www.lansco.de!!!

register_globals is only set by the php.ini-file.

Please try again and test it for about 20 to 30 minutes.

------------------------------------------------------------------------

[2003-08-24 22:57:32] sniper@php.net

Your test site shows the correct output all the time..
Have you checked phpinfo() output when this happens?
(add it to your test script)
What is in section "Apache Environment" for HTTP_HOST then?
(be sure the script gives the error about $HTTP_HOST being undefined)
What is register_globals setting set to at that time? (phpinfo(), both
values)


------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/25172

-- 
Edit this bug report at http://bugs.php.net/?id=25172&edit=1


Thread (19 messages)

« previous php.bugs (#48555) next »