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

Hello

I’m using CS cart, I was using the build in editor to fix a template earlier and I go an Internal Server Error.

When I was reviewing the logs I saw the message:

[Wed Nov 12 11:24:25 2014] [error] [client 86.40.143.6] PHP Fatal error: Namespace declaration statement has to be the very first statement in the script in /usr/local/pem/vhosts/102845/webspace/httpdocs/deliverypaid.com/store/app/lib/vendor/composer/ClassLoader.php on line 13, referer: https://www.deliverypaid.com/store/admin5860.php?dispatch=file_editor.manage

I have no idea what’s wrong with it, anyone know how to fix this as my page has disappeared

Were you modifying the PHP class code directly or just a template file? The error is pretty self exlanatory on what is needed to correct it.

Nah it turns out the site was compromised, there was a load of PHP gibberish at the top of the PHP pages causing the error.

Are you on shared hosting with an SSL installed?

Yup

If financially feasible, I would move to vps. The size is not as important as being able to insulate your files from the possibility of bad code on your shared server infecting your system. If your store is doing well enough, it is far more palatable.

Well we’re just starting out. Going to be launching next week, so it’s not financially viable right now but definitely something I’ll consider in future.

I was dealing with CS cart customer support and I gave them my FTP details to fix a theme issue so someone could have gotten into the site that way. I’ll change all the FTP details and the site admin address/logins and raise the issue with my host

Send me a PM, I may be able to help.

Sponsor our Newsletter | Privacy Policy | Terms of Service