We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How get the HTTP_CLIENT_IP use phalcon?

How get the user client ip?



39.4k
Accepted
answer

You can try this:

// \Phalcon\Http\Request
echo $request->getClientAddress();

or

// \Phalcon\Http\Request
echo $request->getHeader("HTTP_CLIENT_IP");