WordPress.org

Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#4426 closed defect (bug) (fixed)

trouble with feedburner + gzip

Reported by: werwin Owned by: westi
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.2.1
Component: General Keywords: feedburner gzip has-patch
Focuses: Cc:

Description

I'm running 2.2.1-RC1

When having Gzip enabled in Wordpress (Options -> Reading -> WordPress should compress articles (gzip) if browsers ask for them -> Checked), the feeds for FeedBurner will stop working.

Turned Gzip on, example from FeedBurned page (was just working):

XML Parsing Error: not well-formed
Location: http://feeds.feedburner.com/willerwin
Line Number 1, Column 1:?
^

On the administration page when logged into FeedBurner, I'm told:

The URL you entered does not appear to be a valid feed. We encountered the following problem: Your server is sending us some non-XML data. This is usually caused by your blogging platform or server generating an error page that is not in a valid feed format (usually it is plain-text, or HTML). Please confirm that you source feed is working properly.

When validating the feed (just show you can see how it's showing up on http://feedvalidator.org, I get this:

Sorry

This feed does not validate.

    *

      line 1, column 2: 'utf8' codec can't decode byte 0x8b in position 1: unexpected code byte (maybe a high-bit character?) [help]

          ?������?T??<[_?Q?^Z?~???-?zrP??L?"
            ^

    *

      line 1, column 0: XML parsing error: <unknown>:1:0: not well-formed (invalid token) [help]

          ?������?T??<[_?Q?^Z?~???-?zrP??L?"

In addition, this feed has an issue that may cause problems for some users. We recommend fixing this issue.

    *

      "text/xml" media type is not specific enough [help]


Source: http://www.willerwin.com/wp-feed.php

   1. ?������?T??<[_?Q?^Z?~???-?zrP??L?"
   2. ???J??4=.????
   3. vh?4z
???P?&?:??w?????"??M????t?M???]?C?"Z?* HA?85ڣ??546g?????
   4. 
;YǬ?ǪP???f>6??/n>?S&K*???ܸ? ?????P?I=LM??+??D?U
   5. +b?k? ??K??2@,??a?+?o??ģXm?0??=?????
я?H?.???6?f?ݼ???
\??r???0 ??G????E???u?xz??V༥q?????;??4(??
   6. ?6 ???-??x?{???Hw??H?Ҝ???RJT?????o˴>???
?đ???h???X?(?u~1??f4c?????/η?S
"8?.{|L?kČ?|Q?6?
??D???~��??�[3Fi��

When Gzip in wordpress is disabled, FeedBurned support works.
BUT
While having Gzip ON, and not using FeedBurner and using the built-in Wordpress feed (http://www.willerwin.com/wp-feed.php), the Feed shows up properly.

Attachments (2)

4426.diff (694 bytes) - added by westi 13 years ago.
Patch to disable gzip compression if enabled in php.ini
4426-2.diff (737 bytes) - added by rob1n 13 years ago.

Download all attachments as: .zip

Change History (21)

#1 @westi
13 years ago

  • Resolution set to invalid
  • Status changed from new to closed

We use ob_gzhandler to handle the compression of output and that handles deciding if the client supports it.

It looks like either feedburner is sending the wrong headers and is getting gzip encoded data it doesn't expect or you are double zipping your output (for example if apache is also configured to compress output) and that is confusing all clients except the browser.

Looking at your current setup at www.willerwin.com which validates at feedburner so I assume has gzip turned off in WordPress you output is being gziped presumable by the webserver itself.

GET /wp-feed.php HTTP/1.1

Host: www.willerwin.com

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Pragma: no-cache

Cache-Control: no-cache



HTTP/1.1 200 OK

Date: Sat, 09 Jun 2007 11:08:37 GMT

Server: Apache/2.2.4

X-Powered-By: PHP/5.2.3

X-Pingback: http://www.willerwin.com/xmlrpc.php

Last-Modified: Thu, 07 Jun 2007 06:54:33 GMT

ETag: "009c0ed48bea1397f53afbd42a6f2666"

Content-Encoding: gzip

Vary: Accept-Encoding

Content-Length: 586

Keep-Alive: timeout=5, max=100

Connection: Keep-Alive

Content-Type: text/xml; charset=UTF-8



...........T.n.0.<[_.Q.^Z.~...4..i..-...z.rP..L."
.....J..4=....,....,./..
vh.4z.....P.&.:..w..."...?.".Q.M....26.Zt.M...8.].C.".Z..r.*..HA.85....p..6fl[Z546g.`..
..
.;.Y...U..P....f.>6..)
./n>..,.S&K.*....... ..&......K.P..J.G[I=LM...-.+..D.FU
+.b.k....K..z2@,......a..+......o.....Xm.70.._J
..=.......)......H.....6.f........\....Lr.....O0....X.OG..W...n..M...G-E......u..xz...V...q......s.O....;..4(..
..6.......~y.X-.?..zx..C{......Hw..H....p.(..i#RJT.........t...n8o..>...
.........o.h.......wdX.(..u~1..f.4c...M8......Y/...?.S."8..B....{|L....(k...|Q.6....D.......~.......[3Fi....

#2 @rob1n
13 years ago

  • Milestone 2.3 (trunk) deleted

#3 in reply to: ↑ description ; follow-up: @werwin
13 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

I turned off these setting in Apache, since you said it might be a server issue.

#AddEncoding x-gzip .gz .tgz
#LoadModule deflate_module libexec/apache22/mod_deflate.so
#LoadModule mime_module libexec/apache22/mod_mime.so

I then turned on the Wordpress gzip compression and tried FeedBurner again, still getting the error of "The URL you entered does not appear to be a valid feed." The feed works when Wordpress gzip is turned off - the apache settings do not matter.

So the output doesn't look like it's getting double zipped since I turned off those Apache settings.

#4 in reply to: ↑ 3 ; follow-up: @westi
13 years ago

Replying to werwin:

I turned off these setting in Apache, since you said it might be a server issue.

#AddEncoding x-gzip .gz .tgz
#LoadModule deflate_module libexec/apache22/mod_deflate.so
#LoadModule mime_module libexec/apache22/mod_mime.so

I then turned on the Wordpress gzip compression and tried FeedBurner again, still getting the error of "The URL you entered does not appear to be a valid feed." The feed works when Wordpress gzip is turned off - the apache settings do not matter.

So the output doesn't look like it's getting double zipped since I turned off those Apache settings.

Ok.

I assume this is how your server is currently setup: WordPress gzip disabled, apache zip disabled.

I have looked again at the output and it is still gzip encoded so I guess something else is still compressing it which will again lead to double compression if you enable the WordPress option.

I guess you may have "zlib.output_compression" enabled in php.ini or apache config for php?

#5 @Otto42
13 years ago

I say this has to be a configuration problem on your end, somehow, somewhere. Why? Because I'm using GZIP compression and Feedburner and it worksforme.

Might consider posting in the support forums, maybe somebody there has encountered the issue before.

#6 @rob1n
13 years ago

  • Milestone set to 2.4 (future)

#7 in reply to: ↑ 4 @werwin
13 years ago

Replying to westi:

I guess you may have "zlib.output_compression" enabled in php.ini or apache config for php?

In php.ini I do have:

zlib.output_compression = On
zlib.output_compression_level = 5

Isn't that default in php.ini to have compression turned on though?

Otto42: Do you have compression turned on in your php?

#8 @werwin
13 years ago

You were correct with the PHP settings.
Keeping those Apache settings (specified above) turned on, and turning off the zlib.output_compression PHP setting fixed the problem.
I guess Wordpress was trying to double compress everything.

Can a patch be added to the trunk that checks to see that zlib.output_compression is off, before allowing the option in Wordpress to gzip content?

#9 @westi
13 years ago

  • Owner changed from anonymous to westi
  • Status changed from reopened to new

#10 @westi
13 years ago

  • Status changed from new to assigned

#11 @westi
13 years ago

  • Keywords reporter-feedback added

werwin please test the attached patch to see if this fixes your issue.

It should allow you to enable gzip compression with it also enabled in php.ini and only get singly compressed output.

@westi
13 years ago

Patch to disable gzip compression if enabled in php.ini

#12 @werwin
13 years ago

Patched successfully (latest 2.2.1 svn)
Turned PHP gzip compression on.
Wordpress compression off.

  • Feeds work.

Turned Wordpress compression on.

  • Feeds do not work - same problem as original post.

#13 follow-up: @markjaquith
13 years ago

There are a few typos in the patch, Westi.

if ( (ini_get('zlib.output_compression') == 'On') || ini_get('zlib.output_compression' > 0 )) return false;

should be:

if ( (ini_get('zlib.output_compression') == 'On') || ini_get('zlib.output_compression_level') > 0 ) return false;

werwin, can do do:

<?php
var_dump(ini_get('zlib.output_compression'));
var_dump(ini_get('zlib.output_compression_level'));
var_dump(ini_get('output_handler'));
?>

and then paste the output here?

#14 in reply to: ↑ 13 @werwin
13 years ago

Replying to markjaquith:

werwin, can do do:

<?php
var_dump(ini_get('zlib.output_compression'));
var_dump(ini_get('zlib.output_compression_level'));
var_dump(ini_get('output_handler'));
?>

and then paste the output here?

Sure,

string(1) "1" string(1) "5" bool(false) 

#15 @rob1n
13 years ago

  • Keywords has-patch added; reporter-feedback removed

#16 @rob1n
13 years ago

  • Milestone changed from 2.4 (future) to 2.3 (trunk)

#17 @westi
13 years ago

  • Keywords has-patch removed

The current patch is broken.

It removes the option check to see if gzipcompression was every enabled!

@rob1n
13 years ago

#18 @rob1n
13 years ago

  • Keywords has-patch added

#19 @westi
13 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [5810]) Only enable gzip compression if it is not enabled in php.ini. Fixes #4426

Note: See TracTickets for help on using tickets.