最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

errors - strange characters in wordpress website displayed for visitors

programmeradmin5浏览0评论
Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic.

Closed 10 years ago.

Improve this question

Apparently a lot of people complain that they only see random letters and characters:

My biggest problem is that I can't reproduce the problem on ANY of my devices! Not on my Windows XP laptop, not on my Windows 7 laptop, not on my Android phone or my iPod Touch. It doesn't matter which browser I'm using. The only time I see the problem myself is when I try to share one of my blog posts on Google+, because the blog description then appears in strange characters.

So, first of all I need to find a way to reproduce the problem somehow. Otherwise I won't be able to see if what I did fixed the problem or not.

I did everything that @toscho recommended, but nothing helped.

Did anybody ever run into a similar problem or would you know where I could start to look for the problem?

Edit: I contacted my webhost. They couldn't reproduce the problem, just like me. They said that they have enabled gzip compression on their servers. They suggested turning off one plugin after another to see what happens, but as I can't reproduce the problem, I can't do that. Please help!

More and more readers are complaining about this problem. Most of them just need to refresh the page or wait a few minutes and then the site loads normally, but I'm still using a lot of traffic because of that.

EDIT 2: The W3 Total Cache Plugin FAQ says: I see garbage characters instead of the normal web site, what's going on here?

If a theme or it's files use the call php_flush() or function flush() that will interfere with the plugins normal operation; making the plugin send cached files before essential operations have finished. The flush() call is no longer necessary and should be removed.

I am pretty sure that none of my code has this call anywhere, but I'm not 100% sure. Is there any way to find out other than searching through millions of characters in all of my files?

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic.

Closed 10 years ago.

Improve this question

Apparently a lot of people complain that they only see random letters and characters:

My biggest problem is that I can't reproduce the problem on ANY of my devices! Not on my Windows XP laptop, not on my Windows 7 laptop, not on my Android phone or my iPod Touch. It doesn't matter which browser I'm using. The only time I see the problem myself is when I try to share one of my blog posts on Google+, because the blog description then appears in strange characters.

So, first of all I need to find a way to reproduce the problem somehow. Otherwise I won't be able to see if what I did fixed the problem or not.

I did everything that @toscho recommended, but nothing helped.

Did anybody ever run into a similar problem or would you know where I could start to look for the problem?

Edit: I contacted my webhost. They couldn't reproduce the problem, just like me. They said that they have enabled gzip compression on their servers. They suggested turning off one plugin after another to see what happens, but as I can't reproduce the problem, I can't do that. Please help!

More and more readers are complaining about this problem. Most of them just need to refresh the page or wait a few minutes and then the site loads normally, but I'm still using a lot of traffic because of that.

EDIT 2: The W3 Total Cache Plugin FAQ says: I see garbage characters instead of the normal web site, what's going on here?

If a theme or it's files use the call php_flush() or function flush() that will interfere with the plugins normal operation; making the plugin send cached files before essential operations have finished. The flush() call is no longer necessary and should be removed.

I am pretty sure that none of my code has this call anywhere, but I'm not 100% sure. Is there any way to find out other than searching through millions of characters in all of my files?

Share Improve this question edited Jul 20, 2020 at 18:19 Peyman Zakhire 33 bronze badges asked Jul 23, 2012 at 2:03 japanwormjapanworm 5873 gold badges19 silver badges40 bronze badges 5
  • Ignore the markup, that’s only relevant when the page is saved to the local file system or when the server doesn’t send the correct HTTP header. An URL to a page where this happens could help. – fuxia Commented Jul 23, 2012 at 5:36
  • You send the content gzip encoded but the gzip file is invalid. Turn off gzip compression and add the details to your question about how you turned it on. – fuxia Commented Jul 23, 2012 at 6:14
  • 1 Hm, looks like it is gzip encoded twice. See this discussion for something similar. – fuxia Commented Jul 23, 2012 at 6:20
  • I use a plugin called "W3 Total Cache". Within this plugin I turned off the following option: "Enable HTTP (gzip) compression ". Could you see if the problem you mentioned still persists? Thank you. – japanworm Commented Jul 23, 2012 at 6:34
  • It works now as expected. I’ll write an answer with more details … – fuxia Commented Jul 23, 2012 at 6:38
Add a comment  | 

3 Answers 3

Reset to default 8

Let’s start with the output we got before the fix:

What happened here? My guess: a collision between the plugin W3 Total Cache and your web server LiteSpeed. I found a thread in a Drupal forum about a very similar (or the same) issue.

LiteSpeed seems not to send the appropriate HTTP headers for the compressed cache files W3TC stores. In its changelog for version 0.9.2.4 W3TC says:

Fixed LiteSpeed web server support

So the issue seems to be known, and an upgrade should fix it.

If the upgrade did not help …

  • Ask your web hoster. You pay for support, and nobody knows the internals better.
  • Or add …

    AddType application/x-gzip .gz .tgz
    AddEncoding x-gzip .gz .tgz
    

    … to your .htaccess to see if it helps.

  • Or turn gzip compression off in W3TC. That is the last option if all the other approaches fail.

To test the results, do not rely on browser output. All browsers use different workarounds for broken compression, you cannot work with that. Use a tool like GIDZipTest to see if everything is okay.

This happened to me because I had two plugins trying to GZip compress the output. Disabling the second plugin fixed the problem.

Always specify the encoding used for an HTML or XML page. If you don't, characters in your content may be incorrectly interpreted. Look inside your header file to specify English and UTF-8 settings. Here's whats in my header:

<html xmlns="http://www.w3/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
发布评论

评论列表(0)

  1. 暂无评论