Namespace declaration statement has to be the very first statement in the script

客户反馈说点击页面报错,提示

Namespace declaration statement has to be the very first statement in the script

提示位置是:Home\Controller\CatController.class.php

估计是文件有BOM的问题,由于是团队开发,新手直接在目录下建立txt文件,然后改为php或HTML,从而导致出现bom。  

我用netpad++新建了一个php文件,并把Home\Controller\CatController.class.php的内容拷贝到这个文件,重命名为CatController.class.php,然后覆盖源文件,问题解决。


这里有关于这个问题的讨论

http://www.thinkphp.cn/topic/9753.html


你可能感兴趣的:(ThinkPHP,PHP)