#21043 [Opn]: stdin/pipe reportedly fixed
| From: | sniper@php.net | Date: | Mon, 16 Dec 2002 14:28:56 +0000 |
| Subject: | #21043 [Opn]: stdin/pipe reportedly fixed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-27853@lists.php.net to get a copy of this message | ||
ID: 21043
Updated by: sniper@php.net
Reported By: agdr@dcs.st-and.ac.uk
Status: Open
Bug Type: Filesystem function related
Operating System: Solaris 7
PHP Version: 4.2.3
New Comment:
To get the snapshot build, you need to install GNU sed.
(the sed in Solaris is broken)
Previous Comments:
------------------------------------------------------------------------
[2002-12-16 07:42:43] agdr@dcs.st-and.ac.uk
The latest version does not ocmpile with these options. It stops due
to a long line!
This line starts as:
/bin/sh libtool --silent --mode=link gcc -export-dynamic -g -O2
-L/usr/ucblib
and ends as
ernal_functions.lo -lpq -lcrypt -lresolv -lm -ldl -lnsl -lsocket -lgcc
-lcrypt -o sapi/cgi/php-cgi
As for version 4.2.3, I cannot be sure that I am using the cli version
- the output is still full of html. However, the binary that is used
appears to be the same size as the one that is in sapi/cli so I am
guessing that this is it.
------------------------------------------------------------------------
[2002-12-16 06:26:37] sniper@php.net
and make sure you're really using the CLI binary..
------------------------------------------------------------------------
[2002-12-16 06:19:29] derick@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
------------------------------------------------------------------------
[2002-12-16 06:13:29] agdr@dcs.st-and.ac.uk
In bug report 18022 you said that you have fixed the bug that only lets
php read the first line from stdin when used in a pipe. I am still
finding this bug.
The code i use is:
#!/usr/local/bin/php -q
<?PHP
$fp = fopen("php://stdin", "r");
$username = $argv[1];
$mail = "";
while (!feof($fp))
{
$mail = $mail.fgets($fp, 4096);
}
print($mail);
fclose($fp);
?>
This only prints the first line of any file I pipe to it using cat.
PHP was compiled with:
'--with-pgsql' '--enable-cli' '--enable-ftp'
'--enable-sockets'.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21043&edit=1