php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65962 The $_SERVER['REMOTE_ADDR'] contains the IP in the IPv6 format.
Submitted: 2013-10-24 18:25 UTC Modified: 2013-10-24 19:27 UTC
From: aceton at peroxid dot hu Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.5.5 OS: Windows 7 x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aceton at peroxid dot hu
New email:
PHP Version: OS:

 

 [2013-10-24 18:25 UTC] aceton at peroxid dot hu
Description:
------------
The $_SERVER['REMOTE_ADDR'] contains the IP in IPv6 format. I'm using Aprelium's Abyss WebServer X1. With older versions of PHP(5.4.*, 5.3.*), this global value is in IPv4 format.

Test script:
---------------
$ip = $_SERVER['REMOTE_ADDR'];


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-24 18:35 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2013-10-24 18:35 UTC] johannes@php.net
$_SERVER['REMOTE_ADDR'] contains what your webserver reports. PHP doesn't care. Your webserver reports what is actually used.
 [2013-10-24 19:27 UTC] aceton at peroxid dot hu
Then that was strange. I'm accessed my pages via my computer's netbios name. Now it's in IPv6 format, but why... Only the PHP version was changed, anything else aren't.
When I'm trying to connect with IPv4 addresses, the $_SERVER['REMOTE_ADDR'] contains IPv4 address again.

Thanks for the fast answer!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 11:01:34 2024 UTC