remote_addr not returning IPv4 address(remote_addr 不返回 IPv4 地址)
问题描述
我在本地主机上使用 xampp,当我使用 $_SERVER["REMOTE_ADDR"] 它返回 ::1 (也在 phpinfo()代码>).为什么这样做?我希望它返回一个正常的 IP 地址,如 127.0.0.1.我的操作系统是 windows vista.
I am using xampp on localhost and when I use $_SERVER["REMOTE_ADDR"] it returns ::1 (also does this in phpinfo()). Why does it do this? I want it to return a normal ip address like 127.0.0.1. My operating system is windows vista.
推荐答案
::1 是一个 IPv6 地址 和 0:0:0:0:0:0:0:1 的缩写,即 环回地址到本地机器.所以 ::1 与 127.0.0.1 相同,只是通过 IPv6 而不是 IPv4.
::1 is an IPv6 address and an abbreviation for 0:0:0:0:0:0:0:1 that is the loopback address to the local machine. So ::1 is the same as 127.0.0.1 only via IPv6 instead of IPv4.
这篇关于remote_addr 不返回 IPv4 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:remote_addr 不返回 IPv4 地址
基础教程推荐
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何替换eregi() 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
