Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry

Namespace declaration statement has to be the very first statement or after any declare call in the script

Namespace declaration statement has to be the very first statement or after any declare call in the script

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

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;

Remove the white space before your php tag starts 

This thread seems to be talking about the same issue - it sounds like this error is usually caused by having some data sent out of the server before the namespace statement is encountered.

Could your web hosting be inserting some code into your page before the PHP code?
Is there a UTF-8 Byte Order Mark at the beginning of the document?

On the other hand, it could also be a bug in ImageUploader... the main PHP file puts the namespace after the class definition, which I haven't seen in the PHP documentation, which says it should be the very first PHP code. From this page


901 0

Write a Comments


* Be the first to Make Comment

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online