Answer the question
In order to leave comments, you need to log in
Why doesn't php://stdin work in nginx?
$stdin = fopen('php://stdin', 'r');
$line = trim(fgets($stdin));
var_dump($line);
Answer the question
In order to leave comments, you need to log in
Wait. stdin is the input stream. As far as I know, only console PHP has such an implementation.
Perhaps you meant file_get_contents('php://input') - or did I misunderstand?
php://stdin - standard input stream, when working with nginx (php-fpm or cgi) nothing can be read from it.
php://input - POST data can be read from this stream
Judging by the description of the specified library, it works only through the CLI.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question