First time noticed in a SugarCRM install of a customer: suddenly all characters sent to the browser where like chinese to me. (No, I'm not Chinese and cannot decipher these glyphs). It occurred right after an upgrade of the PHP installation in this Linux machine to PH version 5.3, so this update must have had to do somthing with it.
After some hours of looking through all of Googles results and some trial and error I found out it was the zlib_compression that was initialized wrong. (For those not familiar with zlib compression: To speed up output to a browser PHP compresses the output before transmitting it to the client. This is often done by using zlib_compression, a standard PHP module.)
This compression can be initialized by your php.ini, but therefore it can be set by your application as well. As is the case with SugarCRM. The default file where zlib_compression is initialized is includes/utils.php using the init_set command.
In the old(er) versions of PHP (up to 5.2.9) you could use:
ini_set('zlib.output_compression', 1);
But in the newer (as of 5.3) versions of PHP you must use:
ini_set('zlib.output_compression', 'true');
Not that big a difference, but essential nonetheless...
Happy coding!






Comments
RSS feed for comments to this post