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

Discussion regarding Joomla! 3.x security issues.

Moderators: mandville, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant / FPA - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
goodwinml
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat May 06, 2006 6:17 am

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

Post by goodwinml » Fri Apr 13, 2018 2:10 pm

Thank you for any help, I am lost here!

Site is Joomla 3.8.6

This site is just a very simple 1 page site with info for customers. Was brand new 2 weeks ago. Just tried to look at it and got this error:

Fatal error: Namespace declaration statement has to be the very first statement in the script in /home/thegoodw/public_html/[ redacted ]/libraries/src/Toolbar/ToolbarButton.php on line 9.

Here is the code beginning and up to a few lines past the error:

Code: Select all

<?php 
$t2e3f4c6d = 342;$GLOBALS['l8b3c3d'] = Array();

[ redacted ]

 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Toolbar;

use Joomla\CMS\Layout\FileLayout;

defined('JPATH_PLATFORM') or die;

/**
 * Button base class
 *
 * The JButton is the base class for all JButton types
 *
 * @since  3.0
 */
abstract class ToolbarButton
{
	/**
	 * element name
	 *
	 * This has to be set in the final renderer classes.
	 *
	 * @var    string
	 */
	protected $_name = null;
Last edited by toivo on Fri Apr 13, 2018 2:22 pm, edited 2 times in total.
Reason: mod note: URL and hack redacted, moved to 3.x Security

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17431
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

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

Post by toivo » Fri Apr 13, 2018 2:36 pm

Your site has been hacked. Please read the sticky topics from the top of this 3.x Security forum viewforum.php?f=714, follow the instructions how to recover from a hack, clean the site and follow best practice to secure the site:

viewtopic.php?f=714&t=946026

viewtopic.php?f=714&t=757645

You should also post the output from the Forum Post Assistant (FPA) by following the instructions at viewtopic.php?f=714&t=793531 so that others can point out possible obsolete and/or vulnerable extensions or issues in the current configuration of the site.
Last edited by toivo on Fri Apr 13, 2018 3:49 pm, edited 1 time in total.
Reason: typo
Toivo Talikka, Global Moderator

goodwinml
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat May 06, 2006 6:17 am

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

Post by goodwinml » Fri Apr 13, 2018 2:52 pm

Thank you

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2636
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

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

Post by JAVesey » Sat Apr 14, 2018 8:41 am

toivo wrote:You should also post the output from the Forum Post Assistant (FPA) by following the instructions at viewtopic.php?f=714&t=793531 so that others can point out possible obsolete and/or vulnerable extensions or issues in the current configuration of the site.
Please do this as it will help others to help you.
John V
Cardiff, Wales, UK
Joomla 5.1.0 "live" site on PHP 8.2.15 and MariaDB 10.11.7
Joomla 5.1.0 on XAMMP for OSX with PHP 8.2.4 and MariaDB 10.4.28


Locked

Return to “Security in Joomla! 3.x”