Similarly what is the difference between php://output
and php://stdout
?
I was trying to figure out how servers provide php://input
and php://output
. The only way I could think of (given that both php://input
and php://output
are independent of the mysterious php.ini file according to this page in the manual) would be to change stdin
and stdout
to both refer to the connection socket's file descriptor. But then to my chagrin I found out that php://stdin
and php://stdout
were also defined - presumably in a different way.
Is this just redundancy or do these file names actually refer to do different things? Can someone tell me what's going on here?
php://stdin
,php://stdout
andphp://stderr
allow direct access to the corresponding input or output stream of the PHP process." Then it says "php://input
is a read-only stream that allows you to read raw data from the request body." Isn't that the same as stdin? Then even more confusing the document says "php://output
is a write-only stream that allows you to write to the output buffer mechanism in the same way as print and echo." Which really seems to imply stdout and output are the same.