0

Here i want to find the ip address of system,which i want to implement. but i stucked here. I am using cakephp version 3.2. i have worked on it ,getting an incomplete ip ::1,while my machine ip is 155.0.0.1 Below is code

for getting ip

echo $this->request->clientIp();//getting output ::1

 use Cake\Network\Request;

Here i have requested for client ip . In above controller i have used use Cake\Network\Request; I am not very sure about it.

Please suggest me. Where i am doing wrong. will highly appreciate.

sradha
  • 2,216
  • 1
  • 28
  • 48
  • looks like you're getting ipv6 address. what URL are you going to ? Try use the IPV4 address : `http://155.0.0.1/{Route}` alternatively, just disable the IPv6 connections on your local machine. – Pogrindis Mar 07 '16 at 10:28
  • but previously in cakephp 2x version its coming fine. – sradha Mar 07 '16 at 10:32
  • Check your `DataValidation` configure option in Cakephp, it seems they defaulted to ipv6 in their later version. : http://www.dereuromark.de/tag/ipv4-ipv6/#validation – Pogrindis Mar 07 '16 at 10:45

0 Answers0