Namespace declaration statement has to be the very first statement in the script
我在本地测试没问题了放上服务器就提示这个错误。
<?php
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
文件编码。