Home > Backend Development > PHP Tutorial > Solution to content encoding error in PHP program in Firefox

Solution to content encoding error in PHP program in Firefox

WBOY
Release: 2016-07-25 09:03:41
Original
1117 people have browsed it
The PHP program prompts when accessing Firefox: Content encoding error. The page you are trying to view cannot be displayed because it uses an invalid or unsupported compression format.

The PHP program prompts when accessing Firefox: Content encoding error. The page you are trying to view cannot be displayed because it uses an invalid or unsupported compression format. Under IE it just says 'This page cannot be displayed'. The program uses the ThinkPHP framework. After investigating the cause, it was found that it was caused by the use of ob_start('ob_gzhandler') in the program.

The solution is relatively simple: The following two issues may cause this problem. 1. The server does not support this compression format. You can use function_exists('ob_gzhandler') to determine. Solution: change ob_start('ob_gzhandler') to ob_start(); 2. When using ob_start('ob_gzhandler'), the content has been output before. 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 before ob_start, so the program could not run.



source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template