Broken Images on Windows Server

Summary

Images upload to the server correctly and are stored into the configured storage engine, but show up as broken images on the web site.

Solution

The PHP package on the Windows server must be compiled with the –enable-zend-multibyte option. This issue is detailed in PHP bug report #22108

Details

The PHP distribution used is interpreting UTF-8 encoded PHP scripting files and including the file’s byte-order marker (BOM) that appears before the actual file data in the script begins. Both Shopp and WordPress PHP script files are encoded as UTF-8 files, and so they include the BOM at the beginning of the file. When interpreting the files, PHP adds the BOM to the output (the data sent to the browser).

In cases where the data being sent to the browser is not UTF-8 encoded, such as binary data like file downloads or images, the BOM is still getting sent ahead of other output resulting in corrupted images or file downloads. The only solution is to use a build of PHP that uses the –enable-zend-multibyte option during compiling. This option will ignore sending the BOM as part of interpreting the PHP script, and instead only uses the BOM to detect the encoding of the PHP source file allowing the BOM to be sent on an as needed basis when outputting data.

See Also

Broken Images on Windows Server
  • 0.00 / 5 5

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar