Somehow $_SERVER[\'REMOTE_ADDR\'] returns an empty string, i have the same code (as part of a script) running on multiple servers and it works everywhere else,
$_SERVER[\'REMOTE_ADDR\']
Yes it's possible for REMOTE_ADDR to be empty. so if you want you can use this code that I use to get the ip based on HTTP_X_FORWARDED_FOR
I'm checking REMOTE_ADDR first as it is more reliable and sometimes HTTP_X_FORWARDED_FOR can be spoofed by users