laravel 报错:Namespace declaration statement has to be the very first statement in the script

来源:互联网 发布:window10 stc isp软件 编辑:程序博客网 时间:2024/06/07 00:57

一次新增一个控制器之后,开始报错:

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



发现是保存为utf-8格式导致的。

utf-8又分为无BOM和又BOM格式,win自带的文本编辑器是无法修改的,原来无BOM,就维持无BOM,原来有BOM就维持有BOM

解决办法就是,下载个ultraedit,另存为utf-8 无BOM得格式即可。

阅读全文
0 0