致命错误:名称空间声明语句必须是脚本中的第一个语句


Fatal error: Namespace declaration statement has to be the very first statement in the script

加载签名脚本时出现错误。错误如下:

命名空间声明语句必须是脚本中/Applications/MAMP/htdocs/lphoto/cms/php/class/db.php第一行

我使用以下脚本/页面

signin.php

<?php namespace scripts;
 // get the auth class and the db settings
require_once("class/auth.php");
use scripts'auth'auth as authClass;

auth.php

<?php namespace scripts'auth;
require_once 'db.php';
//use scripts'db'db as Database;
class auth extends Database

db.php

<?php namespace scripts'db;

/**
 * Author: Lennard Moll
 * Licence: GNU GPL 3
 * Last edited 18 July 2015
 */
require_once  'db_conf.php';
use scripts'db'db_config as conf;

db_conf.php

<?php 
namespace scripts'db;
我不知道问题出在哪里。希望你们知道怎么修理它。提前感谢

检查php标签和命名空间之间是否有空白。

确保php声明前没有空格或换行符,即<?php