The error MySQL server has gone away is a bad configuration setting on the server. The first work-around that can be tried is the following:
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );
// Load the logger
require_once (JPATH_COMPONENT_ADMINISTRATOR.'/helpers/log.php');
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );
ini_set('mysql.connect_timeout', 300);
ini_set('default_socket_timeout', 300);
// Load the logger
require_once (JPATH_COMPONENT_ADMINISTRATOR.'/helpers/log.php');
A second work-around to try is the following (this is a Joomla core hack !):
// Set flag that this is a parent file
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__) );
// Set flag that this is a parent file
define( '_JEXEC', 1 );
ini_set('mysql.connect_timeout', 300);
ini_set('default_socket_timeout', 300);
define('JPATH_BASE', dirname(__FILE__) );