New Podcast

Posted Tuesday, January 31 at 3:28 pm
  Thomas Turnbull (tom_o_t on drupal.org) and Alan Palazzolo (zzolo on drupal.org) join Mike Anello to talk about their new book from O’Reilly Media, Mapping with Drupal. Mike’s usual co-hosts, Andrew and Ryan, were both unable to participate in the podcast, leaving Thomas and Alan subject to Mike’s long-winded (but extremely interesting by some accounts) questions.
Download Podcast 73
DrupalEasy_ep73_20120131.mp3
Syndicate content

NEWSLETTER

Stay informed on our latest news!

Syndicate content

Testimonial

On March 11th I attended the first DrupalEasy Workshop in Orlando, Florida. I'm an experienced web developer who has recently picked up Drupal as a tool for helping to build high quality content-driven websites. Mike and Ryan were excellent teachers - they gave a thorough overview of a complex topic in a short space of time, and provided plenty of resources for us to continue learning. The workshop is essential for anyone who has previously configured a basic Drupal site and wishes to take their skills to an advanced level. I would not hesitate to recommend DrupalEasy.com training and hope to attend more workshops in the future.

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

Browser FAIL: "Unsupported form of compression" related to PHP notice

One of my sites had a funny error complaining about an "unsupported form of compression" shortly after installing a new module. The browser would return a white screen of death with an error message (Safari and Firefox).

Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

Turning off the module would have stopped the issue, but I did some googling and noticed a post on Drupal.org about a similar content encoding error message for a different module. The problem ended up being related to the level of PHP error reporting on his server - that is, when an error occurs, PHP will send some text at the top of the page informing you of a problem with your code.

Turns out there was a bug in the code. I went digging through the issue queue for that particular module and noticed another user having the same problem, so I submitted a patch and applied the fix to my local code. With any luck, the next release of the module will contain the fix, and nobody will ever have the exact same error.

The problem ended up being caused by the page compression. Drupal uses page compression techniques to zip the outgoing HTML to make the file size smaller, which is supported by most browsers. The white screen happened when the PHP notice got added to the top of the page. Normally, a PHP fatal error would not send any data, just the error. In this case, the problem was just a notice-level error, so the HTML output was still sent, and somehow the notice text was not compressed.

In order to see the error, I used a command-line tool called wget. Then I used a text editor to inspect the top few lines of the incoming source. Most of it will be garbage, but if you're having the same PHP notice problem, you will see the notice right up at the top.

Here's the line I used for wget:
wget --header "Accept-Encoding: gzip,deflate" http://[site_url]

Trackback URL for this post:

http://drupaleasy.com/trackback/224
Your rating: None Average: 4.5 (6 votes)

More Quicktips


3 comments

Guest wrote 43 weeks 5 days ago

Hi. I am cyrus munyao. I have

Hi. I am cyrus munyao. I have had the same problem in contao. this blog has help me alot. however, i solved my problem by setting cache to false. Thanks and God bless you

Guest wrote 1 year 4 weeks ago

I need the patch.

Downloaded updates for Windows 7 today and getting that error everywhere, especially on Facebook.

Please zip it or post it where I can download it.

Thanks
Tim St. John
The Roost, Myrtle Beach SC

tstjohn@sccoast.net

user picture
ryanprice wrote 1 year 2 weeks ago

Tim, I'm sorry, but I think

Tim, I'm sorry, but I think this is something Facebook would have to fix. This patch only applies to anyone running a Drupal site.

Guest wrote 1 year 41 weeks ago

Thanks Ryan, picked up

Thanks Ryan, picked up something similar having added some extra error reporting to a drupal install...

Appreciate the post, found after Googling...

Syndicate content