PHP program in Firefox content encoding error resolution method

Source: Internet
Author: User
The PHP program prompts you when you visit Firefox: The content encoding error cannot display the page you are trying to view because it uses a compressed format that is not valid or unsupported.

The PHP program prompts you when you visit Firefox: The content encoding error cannot display the page you are trying to view because it uses a compressed format that is not valid or unsupported. In IE, it is ' the page cannot be displayed '. The program is a thinkphp framework, the reason for the investigation, the discovery is due to the use of Ob_start (' Ob_gzhandler ') in the program.

The workaround is simple: The following two issues may be causing the problem. 1, the server does not support this compression format, you can use Function_exists (' Ob_gzhandler ') to determine the solution: to change the Ob_start (' Ob_gzhandler ') to Ob_start (); 2. Use Ob_start (' Ob_gzhandler '), the contents of the previous content and the contents of the require include call file are checked before the content output. If unable to find can use Ob_start () before calling other files, use Ob_end_clean () to clear the output after the call;

The mistake I made was that the program was unable to run because it had output content before ob_start.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.