Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Apache + PHP and all the places in my site that use gzip (E.g. CSS in WordPress) no longer loads and just shows a black question mark. I have no idea where to look for the error.

enter image description here

My test script is this:

header( 'Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 1209600 ) );
header( 'Content-type: text/css; charset=UTF-8' );

$http_accept_encoding = $_SERVER["HTTP_ACCEPT_ENCODING"];

if ( strpos( $http_accept_encoding, 'x-gzip' ) !== FALSE ) {
        $encoding = 'x-gzip';
} else if( strpos($http_accept_encoding,'gzip') !== FALSE ) {
        $encoding = 'gzip';
} else {
        $encoding = FALSE;

if ( $encoding ) {
        header( 'Content-Encoding: ' . $encoding );
        echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";

$output = 'Hellooooooooooooooo World';

if ( $encoding ) {
        echo gzcompress( $output, 9 );
} else {
        echo $output;

And the output is here:

It's also inconsistent, sometimes it will load properly sometimes it won't

share|improve this question
What was the last thing you changed just before it stopped working. – EightBitTony Jun 20 '12 at 11:20
I updated the OS via yum update – Brandon Wamboldt Jun 20 '12 at 11:21
Then you need to find out which config file it changed, and revert those changes. Look around the Apache and PHP config files and find out which have been modified. – EightBitTony Jun 20 '12 at 11:33
...more likely to be a change in the libs than the config to cause this. That it's only returning a single character makes me think that maybe gzcompress is returning false. – symcbean Jun 20 '12 at 11:48
up vote 1 down vote accepted

I'm not exactly what caused the issue, but I rolled back to PHP 5.4.3 from PHP 5.4.4 and the problem no longer occurs (Same config files). Putting PHP 5.4.4 back causes the issue again.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.