Answer the question
In order to leave comments, you need to log in
How to fix the bug that filter_input() for INPUT_SERVER returns NULL?
I act according to the official documentation: php.net/manual/en/function.filter-input.php
The following code always returns NULL:
<?php
var_dump(filter_input(INPUT_SERVER, "REMOTE_ADDR", FILTER_VALIDATE_IP);
?>
Debian GNU/Linux 7.11 (wheezy)
Apache/2.2.22 (Debian)
PHP 5.6.30 в режиме CGI
Answer the question
In order to leave comments, you need to log in
The problem can be solved by stopping using PHP in CGI mode.
This is a bug (I will not provide a link).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question