Doc #80282 [Csd]: cannot send binary data to popen
| From: | vanherkmarcel at gmail dot com | Date: | Wed, 28 Oct 2020 10:36:45 +0000 |
| Subject: | Doc #80282 [Csd]: cannot send binary data to popen | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18039@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80282&edit=1
ID: 80282
User updated by: vanherkmarcel at gmail dot com
Reported by: vanherkmarcel at gmail dot com
Summary: cannot send binary data to popen
Status: Closed
Type: Documentation Problem
Package: Filesystem function related
Operating System: Windows
PHP Version: 7.4.11
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thanks!
Previous Comments:
------------------------------------------------------------------------
[2020-10-28 01:15:07] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=9b3cf9cb9871bf78c9ffc468f684642957d4003f
Log: Fix #80282: cannot send binary data to popen
------------------------------------------------------------------------
[2020-10-27 22:44:10] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=101793286959d1113af940727b5c6e2101ac2303
Log: Fix #80282: cannot send binary data to popen
------------------------------------------------------------------------
[2020-10-27 18:14:34] cmb@php.net
Okay, thanks for the explanation. popen() indeed defaults to text
mode on Windows, what explains the reported issue. However, $mode
'wb' is supossed to enable binary mode, and it does so for me (it
is important to write that as 'wb', not as 'bw' or 'w b' etc.)
Since you can no longer reproduce the problem with 'wb', I'm
changing to documentation bug. Please open a new ticket, if you
ever stumble upon 'wb' prepending 0x0D to any 0x0A bytes.
------------------------------------------------------------------------
[2020-10-26 21:58:29] vanherkmarcel at gmail dot com
Hi,
Thanks for trying.
I lost my test code, since I programmed around it. My exe is the CGI interface of a DICOM server
(Conquest DICOM server), and I was using php to forward a POST request to is CGI client dgate.exe.
By default popen($exe, "w") opens in text mode on Windows - this is not documented.
popen($exe, "wb") is not documented either, and when I tried it did seem not start my exe.
There may have been a mixup with PHP versions though.
Marcel
------------------------------------------------------------------------
[2020-10-26 16:17:44] cmb@php.net
> popen($exe, 'wb') fails
I cannot reproduce that. What exactly fails? Is there some error
message? Which executable do you call?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80282
--
Edit this bug report at https://bugs.php.net/bug.php?id=80282&edit=1