Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

learn4u's avatar

Get Real IP Client !

Hello guyz ,

I have an isssue maybe someone can help me !

I want to get the real IP address of the client when he visit a certain page !

I used :

'ip' =>$request->ip(),

But I'am receiving the IP of my server not the client address ! I'am using digital Ocean !

Any Idea why ?

Thank you

0 likes
3 replies
realrandyallen's avatar

That should be the client IP, I guess you could just grab it via vanilla php :

'ip' => $_SERVER['REMOTE_ADDR'],
1 like

Please or to participate in this conversation.