1

I am getting the following error message on my Joomla site:

Fatal error: require(): Cannot redeclare class mailtohelper in /home/web/public_html/joomla/components/com_content/helpers/icon.php on line 84

Any help is appreciated

  • What version of Joomla? Have you made any changes to this file? – Lodder Jan 22 '16 at 10:17
  • the version im using is joomla 3.4.8, and I immigrated to another server ! – zenami Jan 22 '16 at 10:22
  • What version of PHP are you running on your new server? – Lodder Jan 22 '16 at 10:24
  • i'm running PHP Version 5.4.45 – zenami Jan 22 '16 at 10:47
  • 1
    An extension is trying to redeclare a class mailtohelper. This error often occurs to me when I create new extension and forget to rename the class on the helper.php file. Try to disable latest extensions you recently installed and then enable one by one to find which one is causing the problem – Marco Jan 22 '16 at 17:03
1

A 3rd party extension is causing this. The mailtohelper shouldn't be invoked directly. Just use the Joomla mail object:

$mailer = JFactory::getMailer();

Joomla Doc - Sending email from extensions

  • 1
    Pretty sure he's hasn't even suggested he can code. – BodgeIT Nov 22 '16 at 17:52
1

instead of

require ('file_path_here');

try using

require_once('file_path_here');

Whenever you need any file to be included in the current page then remember,

require() includes file that previously been included. require_once() ignore the file if it is previously been included in the same page.

try to figure out difference between include(), include_once(), require(), require_once() then use whichever is best for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.