#27187 [Fbk->Opn]: fpassthru seems to not be binary safe
| From: | php at brokep dot com | Date: | Mon, 09 Feb 2004 06:04:01 +0000 |
| Subject: | #27187 [Fbk->Opn]: fpassthru seems to not be binary safe | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-54594@lists.php.net to get a copy of this message | ||
ID: 27187
User updated by: php at brokep dot com
Reported By: php at brokep dot com
-Status: Feedback
+Status: Open
Bug Type: Filesystem function related
Operating System: Tru64 v5.0a
PHP Version: 5.0.0b3 (beta3)
New Comment:
PHP compililation flags:
--CUT--
./configure --with-apxs2=/apache/bin/apxs
--with-mysql=/usr/local/mysql
--enable-track-vars --enable-inline-optimization --with-xml
--with-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg
--with-gettext --with-xslt --with-imap=/usr/local/imap
--CUT--
Versions:
PHP 5.0.0b3
Apache2, 2.0.48
MySQL 5.0
newest libxml, libxslt, imap-2002e.
I tried the commandline PHP and - surprise - it worked like it should.
I can send you both the php-code and the win32binary that makes it not
work.
Previous Comments:
------------------------------------------------------------------------
[2004-02-08 22:21:25] moriyoshi@php.net
Which web server implementation are you using? (eg.
Apache) and what is the version of it? (eg. 2.0.40)
And could you try it on the CLI version of PHP again?
------------------------------------------------------------------------
[2004-02-08 21:57:05] php at brokep dot com
Description:
------------
While trying this code, my webpage was outputted as empty:
$fp=fopen("windowsfile.exe", "rb");
fpassthru($fp);
If I instead used echo the data i fread() it was no problem.
I tried fpassthru() with ELF-binaries and this was not a problem, only
with the windows-binary file.
Reproduce code:
---------------
$client="/a/win32/binary/file.exe";
$fs=filesize($client);
$fp=fopen($client,"rb");
fpassthru($fp);
Expected result:
----------------
the contents of the $client-file
Actual result:
--------------
An empty webpage.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27187&edit=1