php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19840 I can't get the getenv("HTTP_USER_AGENT")
Submitted: 2002-10-09 21:02 UTC Modified: 2002-11-03 13:24 UTC
From: alietss at yahoo dot com Assigned:
Status: Closed Package: Apache2 related
PHP Version: 4CVS-2002-10-09 OS: linux RedHat 8.0
Private report: No CVE-ID: None
 [2002-10-09 21:02 UTC] alietss at yahoo dot com
Hi boys:
I'm using Linux RedHat8.0 and httpd-2.0.40 from RedHat packages, I built php rpms for this plataform of the PHP-4.2.4-dev snapshot 09/10/2002 to solve a problem related to file_exists, now that problem is solved, I'm using register_global in On but when my scripts run something like this:

getenv("HTTP_USER_AGENT")

I don't get the value that this function return to me in the past PHP-4.2.3, I look the phpinfo() and I can't find this enviroment variable, rather I see a _SERVER["HTTP_USER_AGENT"] enviroment variable, but if I have register_global in On I should see this variable isn't it??
Well I hope this helps beacuse If don't I have to change a lot of code.
                                     Bye Aliet

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-09 21:12 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

The getenv() problem existing till about 2 weeks ago when getenv for Apache 2 was implemented. It works fine for me in Apache 2.0.40 and latest CVS.
var_dump(getenv('HTTP_USER_AGENT'));
var_dump($_SERVER['HTTP_USER_AGENT']);
result in the exact same output. 
By the looks of it, it seems that you've downloaded the 'stable' snapshot, instead you should've downloaded the 'latest' snapshot.
 [2002-11-03 13:16 UTC] ostermmg at whitman dot edu
Although this bug claims to be fixed, I've got the following configuration and am still having problems:

RedHat 7.3
Apache/2.0.43 
mod_ssl/2.0.43 
OpenSSL/0.9.6b 
PHP/4.2.4-dev

Unless something has changed from Apache 2.0.40 to 2.0.43, it seems that the getenv() bug is still present. Using the example code from "[9 Oct 9:12pm] iliaa@php.net", I get the following output:

bool(false) 
string(50) "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" 

Any ideas?
 [2002-11-03 13:24 UTC] iliaa@php.net
You should be using 4.3.0-dev (unstable).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 12 20:01:33 2024 UTC