ecshop网站出现警告的处理方法Warning: Cannot modify header information – headers already sent by

因ecshop网站由VPSfun88网上娱乐机更换空间搬家到乐道香港虚拟空间上,首页打开出现错误:
Warning: Cannot modify header information – headers already sent by (output started at /home/chaoshi/public_html/index.php:1) in /home/cha/public_html/includes/init.php on line 165

Warning: Cannot modify header information – headers already sent by (output started at /home/chaoshi/public_html/index.php:1) in /home/cha/public_html/includes/init.php on line 166

Warning: Cannot modify header information – headers already sent by (output started at /home/chaoshi/public_html/index.php:1) in /home/cha/public_html/includes/cls_template.php on line 58

原来的空间是VPSfun88网上娱乐机可以自由设置php.ini,将output_buffering设为on,不会出现以上错误,更换空间后,因虚拟fun88网上娱乐机管理面板中没有自定义的php.ini设置,只能用别的方法解决以上错误。

 

因ecshop/shopex使用的是uft-8编码,在网站制作和修改中可能将首页文件index.php用.txt记事本工具修改后产生多余bom签名,需要去掉bom才行,最简单的方法是下载:Notepad++ ,将首页index.php中所有代码复制到Notepad++,重新保存为index.php上传到空间即可。

也可以利用个工具清理,参考:如何批量清理BOM头代码文件