note 109786 rejected from book.apc by aharvey
| From: | aharvey@php.net | Date: | Tue, 21 Aug 2012 02:28:47 +0000 |
| Subject: | note 109786 rejected from book.apc by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190150@lists.php.net to get a copy of this message | ||
Note Submitter: aplpa at betamakers dot com
----
On some of my servers, apc.php renders corrupt PNG graphics by sticking carriage returns in the
graphics file.
I see that apc.php renders it's web page and graphics on the fly as a stream achieved via
print/echo commands. On the problem servers the print/echo commands automatically stick a carriage
return after every execution. This is probably because the output stream is not opened in binary
mode but in text mode. If rendering just HTML then either mode will work, but because the apc.php
script draws PNG images then if the output is not in binary mode the PNG file creation gets
corrupted with carriage returns and the resulting image fails on a browser.
I've compared the configs/libraries/packages relating to PHP and Apache between a working and
problem server and they are exactly the same.
Can anyone provide some further insight as to where to look?