|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33477 $_ENV['REMOTE_PORT'] not valid
Submitted: 2005-06-26 01:58 UTC Modified: 2005-06-26 16:57 UTC
From: spiderman_gtp at hotmail dot com Assigned:
Status: Not a bug Package: Network related
PHP Version: 5.0.4 OS: Win2K AS
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: spiderman_gtp at hotmail dot com
New email:
PHP Version: OS:


 [2005-06-26 01:58 UTC] spiderman_gtp at hotmail dot com
$_ENV['REMOTE_ADDR'] returns the correct value of the IP of the remote user,

$_ENV['REMOTE_PORT'] generates:

Notice: Undefined index: REMOTE_PORT in ...

Reproduce code:
see description .. i also tried $HTTP_ENV ... and $_SERVER and none seem to work

Expected result:
expected to return the remote users port number

Actual result:
Notice: Undefined index: REMOTE_PORT in ...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-26 12:51 UTC]
If it's not set then it's not set by the webserver.
Not PHP problem since PHP only fills the $_ENV variable with the environment variables which actually are SET.

 [2005-06-26 16:57 UTC] spiderman_gtp at hotmail dot com
fair enough ... so how would i SET the variable on the webserver? I don't recall setting the 'REMOTE_ADDR' on the webserver, and it works fine ... all i am looking for is determining the client request port number .. perhaps this is not a bug, as you say, but it is listed in the documentation and there is no mention of set or not set ... is this an IIS setting issue?
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Oct 05 08:05:55 2022 UTC