2013年1月10日星期四

Cannot modify header information vq2-system错误的解决

    在opencart安装vqmod以后,服务器突然出现了跳转错误,某一些$this->redirect()页面不能跳转出现空白情况。查了很久一直以为是因为打开了seo_url模式,以为rewrite或.htaccess出现了问题,耽搁半日不得解决。

    后在opencart-system-setting中打开error display发现错误提示Warning: Cannot modify header information - headers already sent by (output started at /public_html/catalog/common/seo_url.php) in/ /public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 28 这时真的发现了一个非常非常SB的东西,想起来多年前在JOOMLA中曾碰到过一次,心中感慨万千,解决方法是,使用notepad打开提示中的seo_url.php,转成encode utf8 without BOM,确保在提示出现的php文件中在其<?php 之前不出现任何的空格就OK了。 
    这个PHP的通用错误是在是太SB了,headers already sent错误最简单的避免方式是大家把IDE都设成utf8+without BOM吧。 
   
对已安装vqmod vq2-system.php的opencart中出现 Warning: Cannot modify header information错误问题的解决方法,希望能帮到大家。

没有评论: