Php HTML文件作为奇怪字符大杂烩返回

Php HTML文件作为奇怪字符大杂烩返回,php,html,encoding,Php,Html,Encoding,我的应用程序中有以下代码: header('Content-Type: text/html; charset=utf-8'); header('Content-Length: ' . filesize($filename)); header('Content-Disposition: inline; filename=' . $filename); header('Content-Transfer-Encoding: binary'); ob_clean(); @readfile($filen

我的应用程序中有以下代码:

header('Content-Type: text/html; charset=utf-8');

header('Content-Length: ' . filesize($filename));
header('Content-Disposition: inline; filename=' . $filename);
header('Content-Transfer-Encoding: binary');
ob_clean();
@readfile($filename);
它应该读取html文件并写入响应输出

现在发生的一件奇怪的事情是,这在一台服务器上运行得非常好,而在另一台服务器上,它返回类似于编码错误的内容,如


���&�莱伊�]�����8.���O��:���x��בw�六安����������+�G��͟>m��O�H&�工作�u>��_��(�U��Z�_}�E�����在…上�o��Y我找到了解决方案,但我不清楚为什么。它不是
ob\u clean()
而是
ob\u end\u clean()

这是一个问题吗?它是发生在只包含此代码的PHP文件中,还是实际代码实际上做了其他事情?它是最小的、完整的和可验证的,是的。代码除了根据一些GET参数计算文件名外,没有其他作用