致命错误:命名空间声明语句必须是脚本中的第一条语句 [英] Fatal error: Namespace declaration statement has to be the very first statement in the script in
本文介绍了致命错误:命名空间声明语句必须是脚本中的第一条语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图用它来为我的网站创建一个图像表单上传,之所以使用它是因为它比我自己做的所有事都更安全(但是如果有人可以指出另一个可以工作的 >脚本,我将不胜感激)
I'm trying to use this to create a image form upload for my website, the reason I'm using this is because it's more secure than doing everything myself (but if someone could point another working script I would be appreciated)
Fatal error: Namespace declaration statement has to be the very first statement in the script in C:\xampp\htdocs\project\lib\ImageUploader.php on line 4
查看源代码:
<br />
<b>Fatal error</b>: Namespace declaration statement has to be the very first statement in the script in <b>C:\xampp\htdocs\project\lib\ImageUploader.php</b> on line <b>4</b><br />
我尝试过包含,要求,但仍然无法正常工作.
I've tried with includes, requires and it still doesn't work.
推荐答案
有时此问题是由于控制器的PHP开始标记中的空间不足而引起的 面临同样的问题只是删除了以下空格:
Sometimes this issue come because of space in PHP start tag of controller facing same issue just removed whitespace in:
<?php
namespace App\Http\Controllers\Auth;
删除空间解决了我的错误
removing the space resolved my error
这篇关于致命错误:命名空间声明语句必须是脚本中的第一条语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文