首页 > 解决方案 > how to get server ip4 *and* ip6 using php

问题描述

I want to retrieve ip4 and ip6 address of my server in a php script. Actually I use $_SERVER['SERVER_ADDR'] - this returns my ip6 address.

  1. Why does it return my ip6 address? My server does have two addresses: ip4 AND ip6?
  2. Can I force getting ip6 / ip4?

标签: phpserver

解决方案


推荐阅读