Namespace declaration statement has to be the very first statement or after any declare call in the script
0x00缘起
代码部署在windows上,出现了一个bug,临时用记事本打开修改了一下,于是出现了500错误
0x01排错
查看log,提示如下
“Namespace declaration statement has to be the very first statement or after any declare call in the script xxx.controller”。于是看这个php文件,什么也没发现。
一头雾水,只好在网上找了一下,没想到是万恶的bom引起的。
0x03解决办法
重新保存为utf-8无bom格式。
作者:半山
出处:http://www.cnblogs.com/xdao/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。