Bug #66854 [Opn->Nab]: STDERR and STDIN are undefined in CLI SAPI
| From: | ab@php.net | Date: | Tue, 25 Mar 2014 14:23:39 +0000 |
| Subject: | Bug #66854 [Opn->Nab]: STDERR and STDIN are undefined in CLI SAPI | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184881@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66854&edit=1
ID: 66854
Updated by: ab@php.net
Reported by: martin dot koranda at gmail dot com
Summary: STDERR and STDIN are undefined in CLI SAPI
-Status: Open
+Status: Not a bug
Type: Bug
Package: Built-in web server
Operating System: windows
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Ah, it is CLI SAPI in the title but that's about the built-in webserver SAPI. There that's
fine. STDIN, STDOUT and STDERR are only defined in the CLI SAPI, there is also special handling for
CLI. But starting the built-in server you're not it the CLI SAPI anymore, but in the
"Apache like" one. While the pure CLI will reuse the predefined stdin, stdout and stderr
FILE pointers, the other CLIs expect some predefined file descriptor.
I don't see how can this be related to libreadline and and others.
thanks
Previous Comments:
------------------------------------------------------------------------
[2014-03-20 11:14:23] martin dot koranda at gmail dot com
<?php
echo STDERR;
echo STDIN;
---------------
run this via CLI SAPI like php -S localhost:8080 and the output is:
Notice: Use of undefined constant STDIN - assumed 'STDIN'
Notice: Use of undefined constant STDERR - assumed 'STDERR'
seems that it does not affect those who have Readline/Libedit compiled with php
------------------------------------------------------------------------
[2014-03-11 09:57:57] ab@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
php -n -r "var_dump(STDIN, STDERR);"
resource(1) of type (stream)
resource(3) of type (stream)
Please post some reproduce way.
Thanks.
------------------------------------------------------------------------
[2014-03-08 15:39:45] martin dot koranda at gmail dot com
Description:
------------
For some reason, the CLI SAPI doesn't define STDERR and STDIN constants, even though
'php://stderr' and 'php://stdin' still work like you'd expect.
This only affected people without Readline or Libedit.
php 5.5.10 on windows8x64
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66854&edit=1