Hello, when i am using request ->getClientAddress() i am getting return value 'false', when i look at the source code here i am suppose to get the value from $_SERVER["REMOTE_ADDR"].But the value in the superglobal is :::1, why i am getting false ?
|
Aug '17 |
5 |
1015 |
0 |
Hello, when i am using request ->getClientAddress() i am getting return value 'false', when i look at the source code here i am suppose to get the value from $_SERVER["REMOTE_ADDR"].But the value in the superglobal is :::1, why i am getting false ?
In my Debian Jessie vps
Phalcon version: 3.2.1 PHP Version: PHP 7.1.7 Server: Apache2
$var dump give me my ipv4 address (string xxx.xxx.xxx.xxx (length=15))
it's in your configuration but what, you use a proxy ?
have you check $_SERVER["HTTP_X_FORWARDED_FOR"] and $_SERVER["HTTP_CLIENT_IP" if it is set, the code does not do this code
if address === null {
fetch address, _SERVER["REMOTE_ADDR"];
}
That's IPv6 address, i.e. your own loopback interface - configure your server to have IPv6 disabled.
Hello,
when i call $this->request->getServer("REMOTE_ADDR")
i am getting ::1
, but when i call $this->request->getClientAddress()
i am getting false
, how is that possible ?, also when i am making ajax request $this->request->isAjax
is returning false
but when i call $this->request->getServer("HTTP_X_REQUESTED_WITH")
i am getting XMLHttpRequest
Did you follow my reply here that you're getting your own localhost in IPv6 format? What is not clear about that? Try accessing your server/app from elsewhere but your own server/workstation.
If it still fails, your app and/or server are badly configured.
I guess your Router componenet and web server are not playing nice together. Post your web and Phalcon bootstrap (services) config.