Home >Backend Development >PHP Tutorial >Solving the problem of ThinkPHP312 website compression format error under windows

Solving the problem of ThinkPHP312 website compression format error under windows

WBOY
WBOYOriginal
2016-07-29 08:48:561173browse

On the Windows platform, when using Firefox to generate website files corresponding to ThinkPHP 3.1.2 version, the following error is reported:
The page you are trying to view cannot be displayed because it uses an invalid or unsupported compression format.
Please contact the owner of the website to inform them of this issue.


After investigation, it was caused by ob_start('ob_gzhandler') in the framework directory ThinkPHP/Lib/Core/App.class.php. The reason is:
The server does not support this compression format. You can use function_exists(' ob_gzhandler') judgment, Solution ob_start('ob_gzhandler') is changed to ob_start();
Line 49 ob_start('ob_gzhandler') is changed to ob_start();
Line 271 ob_start('ob_gzhandler') is changed to ob_start ();
Windows platform does not support file compression in gzip format, so if an error is reported, just correct it to empty parameters.

The above introduces the solution to the problem of error reporting in ThinkPHP312 website compression format under Windows, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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