php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9851 getenv() functions do not return variables.
Submitted: 2001-03-19 21:07 UTC Modified: 2002-08-13 23:14 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: kabal at ev01 dot net Assigned:
Status: Not a bug Package: iPlanet related
PHP Version: 4.0.3pl1 OS: Solaris 2.6/2.7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
22 - 13 = ?
Subscribe to this entry?

 
 [2001-03-19 21:07 UTC] kabal at ev01 dot net
The getenv() function does not return a value.

machine info:

[root@wink]# uname -a
SunOS wink 5.6 Generic_105181-16 sun4u sparc SUNW,Ultra-2
[root@wink]# php -v
4.0.3pl1

Netscape-Enterprise/3.6 SP3 B99.280.0054


sample code:

<?php
        $rmh = "remote";
        $hr = "http ref";
        $sn = "script name";
        $ra = "rem add";
        $ip = "testip";
        $test = $REMOTE_ADDR ;
        $host = $HTTP_HOST;
        $myhost = "HOSTweb01";
        $IP = getenv('REMOTE_ADDR');
        $IPGET = "ip from getenv = ";
        $HTTPGET = "HTTP_REFERER from get env=  ";
        $http_ref = getenv('HTTP_REFERER');       
        $scname = getenv('SCRIPT_NAME');
        $SCTEST = "SCRIPT_NAME from getenv = ";
          

        
        print (" $hr $HTTP_REFERER <BR>\n");
        print (" $sn  $SCRIPT_NAME <BR>\n");
        print ("$ra  $REMOTE_ADDR <BR>\n");
        print (" $ip $IP <BR>\n"); 
        print ("$rmh $test <BR>\n") ;
        print ("$myhost $host<BR><BR>\n<BR>\n\n");
        print ("$IPGET  $IP<BR>\n");
        print ("$HTTPGET $http_ref<BR>\n");
        print ("$SCTEST $scname<BR>\n");

?>

for example $test retuns the correct value while $IP does not.  This also works fine with apache but not with Netscape. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-13 23:14 UTC] kalowsky@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 18:01:34 2024 UTC