|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77722 Incorrect IP set to $_SERVER['REMOTE_ADDR'] on the localhost
Submitted: 2019-03-10 20:34 UTC Modified: 2019-03-12 08:41 UTC
From: josef dot sabl at gmail dot com Assigned: nikic (profile)
Status: Closed Package: Built-in web server
PHP Version: 7.3.3 OS: Windows
Private report: No CVE-ID: None
 [2019-03-10 20:34 UTC] josef dot sabl at gmail dot com
If run as `php.exe -S localhost:88` the `$_SERVER['REMOTE_ADDR'] === '[::1]'` with the ::1 enclosed in brackets which is invalid and doesn't work with `inet_pton`

More info here:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-03-11 11:37 UTC]
-Status: Open +Status: Verified
 [2019-03-11 11:37 UTC]
I can confirm the erroneous behavior.  It has been introduced with
commit 9501304[1].

[1] <;a=commit;h=95013042bf85ce1f52e476c5cc301faa97f52a72>
 [2019-03-11 22:36 UTC]
-Status: Verified +Status: Assigned -Assigned To: +Assigned To: nikic
 [2019-03-11 22:36 UTC]
Nikita, can you clarify this behaviour as the original committer of this change? And re-classify it as a doc bug if indeed so
 [2019-03-12 08:41 UTC]
@kalle: The change is correct, but interacts incorrectly with the CLI server code in, which tries to extract the address simply by taking everything before ":". For IPv6 it additionally needs to strip the brackets.
 [2019-03-12 08:58 UTC]
Automatic comment on behalf of
Log: Fixed bug #77722
 [2019-03-12 08:58 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 12:01:28 2024 UTC