Home  >  Article  >  Backend Development  >  Content encoding error occurs in firefox_PHP tutorial

Content encoding error occurs in firefox_PHP tutorial

WBOY
WBOYOriginal
2016-07-22 09:02:56953browse

  Firefox prompts that the content encoding error occurs when accessing a program using PHP with a browser. The page you are trying to view cannot be displayed because it uses an invalid or unsupported compression format. Under IE, it is 'The page cannot be displayed'. Use ThinkPHP framework, I never knew the reason. Later, I checked step by step and found that it was caused by using ob_start('ob_gzhandler') in the program.

 The solution to this problem is actually very simple. The following two problems may cause this problem.

 1. The server does not support this compression format. You can use function_exists('ob_gzhandler') to judge. The solution is to change ob_start('ob_gzhandler') to ob_start();

 2. When using ob_start('ob_gzhandler'), the previous content has been output. Check the previous content and the content of the require include calling file. If it cannot be found, you can use ob_start() before calling other files, and use ob_end_clean () after calling to clear the output content;

 The error I encountered was because there was output content before ob_start. That's why the program cannot run.

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/371830.htmlTechArticle When accessing a program using PHP with a browser, Firefox prompts a content encoding error and cannot display the page you are trying to view because it uses an invalid or unsupported compression format, and under IE...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn