namespace declaration statement has to be the very first statement in the script
我在本地测试没问题了放上服务器就提示这个错误。
namespace common\modules\post\models;
use yii;
use yii\db\activerecord;
use yii\behaviors\timestampbehavior;
use common\modules\user\models\user;
namespace得是第一个语句我也没错呀,到linux下怎么报错了
回复内容: namespace declaration statement has to be the very first statement in the script
我在本地测试没问题了放上服务器就提示这个错误。
namespace common\modules\post\models;
use yii;
use yii\db\activerecord;
use yii\behaviors\timestampbehavior;
use common\modules\user\models\user;
namespace得是第一个语句我也没错呀,到linux下怎么报错了
编码问题,编码造成了在namesapce之前还有不可见但可被php识别的字符。是utf-8编码的吗?如果是,要使用无bom的utf-8文件编码。
如楼上所说,utf8-无dom(bom)
windows下可以用notepad++方便查看编码.
楼上勾引我犯错
应该叫bom吧