iT邦幫忙

0

為什麼無法用 php 取得IP? XAMPP的ProFTPD壞了

$SERVER["REMOTEADDR"]
errorreporting (EERROR | EWARNING | EPARSE);
  if($HTTPSERVERVARS["HTTPXFORWARDEDFOR"]){
   $ip = $HTTPSERVERVARS["HTTPXFORWARDEDFOR"];
  }
  elseif($HTTPSERVERVARS["HTTPCLIENTIP"]){
   $ip = $HTTPSERVERVARS["HTTPCLIENTIP"];
  }
  elseif ($HTTPSERVERVARS["REMOTEADDR"]){
   $ip = $HTTPSERVERVARS["REMOTEADDR"];
  }
  elseif (getenv("HTTPXFORWARDEDFOR")){
   $ip = getenv("HTTPXFORWARDEDFOR");
  }
  elseif (getenv("HTTPCLIENTIP")){
   $ip = getenv("HTTPCLIENTIP");
  }
  elseif (getenv("REMOTEADDR")){
   $ip = getenv("REMOTEADDR");
  }
  else{
   $ip = "Unknown";
  }

好怪!不管用哪種
我的IP都會顯示 ::1
怎麼會這樣?

我看xampp的LOG寫

Starting ProFTPD...
Exit code: 8
Stdout:
Checking syntax of configuration file
proftpd config test fails, aborting
Stderr:
xxx-2.local proftpd[1549]: warning: unable to determine IP address of 'xxx-2.local'
xxx-2.local proftpd[1549]: error: no valid servers configured
xxx-2.local proftpd[1549]: Fatal: error processing configuration file '/Applications/XAMPP/xamppfiles/etc/proftpd.conf'

整個壞掉了
我也不知道是什麼原因?根本沒有動到呀

weiclin iT邦高手 4 級 ‧ 2018-05-16 18:23:20 檢舉
ipv6 的 localhost
火爆浪子 iT邦研究生 1 級 ‧ 2018-05-16 21:42:54 檢舉
我查了一下好像是 升級sierra關係
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答