Ticket #4426 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

trouble with feedburner + gzip

Reported by: werwin Assigned to: westi
Priority: normal Milestone: 2.3
Component: General Version: 2.2.1
Severity: normal Keywords: feedburner gzip has-patch
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

4426.diff (0.7 kB) - added by westi on 06/14/07 14:18:47.
Patch to disable gzip compression if enabled in php.ini
4426-2.diff (0.7 kB) - added by rob1n on 06/17/07 21:05:29.

Change History

06/09/07 11:11:59 changed by westi

  • status changed from new to closed.
  • resolution set to invalid.

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....

06/09/07 15:30:24 changed by rob1n

  • milestone deleted.

(in reply to: ↑ description ; follow-up: ↓ 4 ) 06/10/07 05:34:09 changed by werwin

  • status changed from closed to reopened.
  • resolution deleted.

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.

(in reply to: ↑ 3 ; follow-up: ↓ 7 ) 06/10/07 09:41:12 changed by westi

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?

06/11/07 16:43:23 changed by Otto42

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.

06/11/07 16:51:04 changed by rob1n

  • milestone set to 2.4 (future).

(in reply to: ↑ 4 ) 06/14/07 02:48:53 changed by werwin

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?

06/14/07 07:37:26 changed by werwin

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?

06/14/07 09:36:49 changed by westi

  • owner changed from anonymous to westi.
  • status changed from reopened to new.

06/14/07 09:36:57 changed by westi

  • status changed from new to assigned.

06/14/07 14:18:23 changed by westi

  • keywords changed from feedburner, gzip to feedburner, gzip reporter-feedback.

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.

06/14/07 14:18:47 changed by westi

  • attachment 4426.diff added.

Patch to disable gzip compression if enabled in php.ini

06/14/07 17:30:06 changed by werwin

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.

(follow-up: ↓ 14 ) 06/14/07 18:30:21 changed by markjaquith

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?

(in reply to: ↑ 13 ) 06/15/07 03:27:13 changed by werwin

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) 

06/15/07 17:08:30 changed by rob1n

  • keywords changed from feedburner, gzip reporter-feedback to feedburner, gzip has-patch.

06/15/07 17:08:35 changed by rob1n

  • milestone changed from 2.4 (future) to 2.3 (trunk).

06/17/07 09:09:16 changed by westi

  • keywords changed from feedburner, gzip has-patch to feedburner, gzip.

The current patch is broken.

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

06/17/07 21:05:29 changed by rob1n

  • attachment 4426-2.diff added.

06/17/07 21:05:42 changed by rob1n

  • keywords changed from feedburner, gzip to feedburner gzip has-patch.

07/18/07 21:12:23 changed by westi

  • status changed from assigned to closed.
  • resolution set to fixed.

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