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

image-upload, php

Solution

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

Problem

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) simon-eQ / ImageUploader ``` 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 ``` Looking at the source code: ``` <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.

Original source