php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16679 getenv() function may not work properly
Submitted: 2002-04-18 09:52 UTC Modified: 2002-04-18 10:02 UTC
From: royerj at free dot fr Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.2.0 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: royerj at free dot fr
New email:
PHP Version: OS:

 

 [2002-04-18 09:52 UTC] royerj at free dot fr
When i tried to call the getenv("SERVER_ADDR") method, the return is an empty string.
I know that I can use $_SERVER["SERVER_ADDR"] but I must use the getenv() method.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-18 10:00 UTC] royerj at free dot fr
Not a bug...
I've just seen that this method is only available in CGI mode...
Sorry
 [2002-04-18 10:02 UTC] hholzgra@php.net
yes, that's why we have the $_SERVER array,
as an abstraction Layer to Werbser APIs 
variable access methods

CGI has to rely on process environment
variables for parameter passing, but most
server-module APIs have faster methods to
do this and usualy don't bother to set the
environment variables
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC