I am running an apache2 server where I do my localhost testing (PHP 5.5), but my hosting provider has PHP 5.3. I don\'t know whether that is an issue, but I mention it just
I had the same problem, I won't be able to tell you why it returns an empty string/FALSE but for me using INPUT_ENV
instead of INPUT_SERVER
did work and returns the same IP-address as $_SERVER['REMOTE_ADDR']
. Same goes for HTTP_USER_AGENT
. Short example:
$REMOTE_ADDR = filter_input(INPUT_ENV, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
My guess would be something related to this bug: https://github.com/wp-stream/stream/issues/254
Try to use the bugfix on your code as a workaround