If you are beginner in zend framework 2 than mostly you will get error like : Namespace has to be the very first statement in zend framework 2 .
It’s error due to syntax. You just need to do one change in the file. Error will be solved after that change.
Follow simple steps to avoid error.
Step 1 : Open Module.php file in your zend framework 2 project.
Step 2 : You will find <? php OR <?php over there.
Step 3 : Just simple remove white space before the <?php tag in this file.
Step 4 : Refresh your page. Error were gone.
Let me know, If you have not solve your problem. I am happy to solve your problem. Happy Coding 🙂