- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2020
08:49 PM
03-10-2020
08:49 PM
Fatal error: Namespace declaration statement has to be the very first statement or after any declare
Why I ma getting this error and how can I resolve it ?
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in C:\xampp\htdocs\magento2\vendor\magento\framework\View\Element\Template\File\Validator.php on line 6
Labels:
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2020
09:36 PM
03-10-2020
09:36 PM
Re: Fatal error: Namespace declaration statement has to be the very first statement or after any dec
Hello @testnathco5024
In php syntax, You should use namespace in the first line.
Can you just open that file and check namespace [PHP_CLASS_PATH];
It should be right after the <?php tag starting.
Hope it helps.
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.
200+ Magento 2 Extensions for Enhanced Shopping Experience.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020
11:15 PM
03-12-2020
11:15 PM
Re: Fatal error: Namespace declaration statement has to be the very first statement or after any dec
Ensure that your code starts like -
<?php namespace Vendor\Module\Folder\Folder;
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2020
02:11 AM
08-09-2020
02:11 AM
Re: Fatal error: Namespace declaration statement has to be the very first statement or after any dec
still the error is there in mine