title: Magento emails not sending - core_email_queue table is empty in database
body: <p>No emails are being sent from magento. Cron is set up properly and I've just noticed that now the core_email_queue table is empty in the database, although we have had new orders. I've tried various things with template.php to get the emails to work but have always reverted my changes so dont think anything is wrong there?</p>
  
  <p>Template.php</p>
  
  <pre><code>&lt;?php
  /**
   * Magento
   *
   * NOTICE OF LICENSE
   *
   * This source file is subject to the Open Software License (OSL 3.0)
   * that is bundled with this package in the file LICENSE.txt.
   * It is also available through the world-wide-web at this URL:
   * http://opensource.org/licenses/osl-3.0.php
   * If you did not receive a copy of the license and are unable to
   * obtain it through the world-wide-web, please send an email
   * to license@magento.com so we can send you a copy immediately.
   *
   * DISCLAIMER
   *
   * Do not edit or add to this file if you wish to upgrade Magento to newer
   * versions in the future. If you wish to customize Magento for your
   * needs please refer to http://www.magento.com for more information.
   *
   * @category    Mage
   * @package     Mage_Core
   * @copyright  Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
   * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
   */
  
  /**
   * Template model
   *
   * Example:
   *
   * // Loading of template
   * $emailTemplate  = Mage::getModel('core/email_template')
   *    -&gt;load(Mage::getStoreConfig('path_to_email_template_id_config'));
   * $variables = array(
   *    'someObject' =&gt; Mage::getSingleton('some_model')
   *    'someString' =&gt; 'Some string value'
   * );
   * $emailTemplate-&gt;send('some@domain.com', 'Name Of User', $variables);
   *
   * @method Mage_Core_Model_Resource_Email_Template _getResource()
   * @method Mage_Core_Model_Resource_Email_Template getResource()
   * @method string getTemplateCode()
   * @method Mage_Core_Model_Email_Template setTemplateCode(string $value)
   * @method string getTemplateText()
   * @method Mage_Core_Model_Email_Template setTemplateText(string $value)
   * @method string getTemplateStyles()
   * @method Mage_Core_Model_Email_Template setTemplateStyles(string $value)
   * @method int getTemplateType()
   * @method Mage_Core_Model_Email_Template setTemplateType(int $value)
   * @method string getTemplateSubject()
   * @method Mage_Core_Model_Email_Template setTemplateSubject(string $value)
   * @method string getTemplateSenderName()
   * @method Mage_Core_Model_Email_Template setTemplateSenderName(string $value)
   * @method string getTemplateSenderEmail()
   * @method Mage_Core_Model_Email_Template setTemplateSenderEmail(string $value)
   * @method string getAddedAt()
   * @method Mage_Core_Model_Email_Template setAddedAt(string $value)
   * @method string getModifiedAt()
   * @method Mage_Core_Model_Email_Template setModifiedAt(string $value)
   * @method string getOrigTemplateCode()
   * @method Mage_Core_Model_Email_Template setOrigTemplateCode(string $value)
   * @method string getOrigTemplateVariables()
   * @method Mage_Core_Model_Email_Template setOrigTemplateVariables(string $value)
   * @method Mage_Core_Model_Email_Template setQueue(Mage_Core_Model_Abstract $value)
   * @method Mage_Core_Model_Email_Queue getQueue()
   * @method int hasQueue()
   *
   * @category    Mage
   * @package     Mage_Core
   * @author      Magento Core Team &lt;core@magentocommerce.com&gt;
   */
  class Mage_Core_Model_Email_Template extends Mage_Core_Model_Email_Template_Abstract
  {
      /**
       * Configuration path for default email templates
       */
      const XML_PATH_TEMPLATE_EMAIL               = 'global/template/email';
      const XML_PATH_SENDING_SET_RETURN_PATH      = 'system/smtp/set_return_path';
      const XML_PATH_SENDING_RETURN_PATH_EMAIL    = 'system/smtp/return_path_email';
  
      protected $_templateFilter;
      protected $_preprocessFlag = false;
      protected $_mail;
      protected $_bccEmails = array();
  
      static protected $_defaultTemplates;
  
      /**
       * Initialize email template model
       *
       */
      protected function _construct()
      {
          $this-&gt;_init('core/email_template');
      }
  
      /**
       * Retrieve mail object instance
       *
       * @return Zend_Mail
       */
      public function getMail()
      {
          if (is_null($this-&gt;_mail)) {
              $this-&gt;_mail = new Zend_Mail('utf-8');
          }
          return $this-&gt;_mail;
      }
  
      /**
       * Declare template processing filter
       *
       * @param   Varien_Filter_Template $filter
       * @return  Mage_Core_Model_Email_Template
       */
      public function setTemplateFilter(Varien_Filter_Template $filter)
      {
          $this-&gt;_templateFilter = $filter;
          return $this;
      }
  
      /**
       * Get filter object for template processing logi
       *
       * @return Mage_Core_Model_Email_Template_Filter
       */
      public function getTemplateFilter()
      {
          if (empty($this-&gt;_templateFilter)) {
              $this-&gt;_templateFilter = Mage::getModel('core/email_template_filter');
              $this-&gt;_templateFilter-&gt;setUseAbsoluteLinks($this-&gt;getUseAbsoluteLinks())
                  -&gt;setStoreId($this-&gt;getDesignConfig()-&gt;getStore());
          }
          return $this-&gt;_templateFilter;
      }
  
      /**
       * Load template by code
       *
       * @param   string $templateCode
       * @return   Mage_Core_Model_Email_Template
       */
      public function loadByCode($templateCode)
      {
          $this-&gt;addData($this-&gt;getResource()-&gt;loadByCode($templateCode));
          return $this;
      }
  
      /**
       * Load default email template from locale translate
       *
       * @param string $templateId
       * @param string $locale
       */
      public function loadDefault($templateId, $locale=null)
      {
          $defaultTemplates = self::getDefaultTemplates();
          if (!isset($defaultTemplates[$templateId])) {
              return $this;
          }
  
          $data = &amp;$defaultTemplates[$templateId];
          $this-&gt;setTemplateType($data['type']=='html' ? self::TYPE_HTML : self::TYPE_TEXT);
  
          $templateText = Mage::app()-&gt;getTranslator()-&gt;getTemplateFile(
              $data['file'], 'email', $locale
          );
  
          if (preg_match('/&lt;!--@subject\s*(.*?)\s*@--&gt;/u', $templateText, $matches)) {
              $this-&gt;setTemplateSubject($matches[1]);
              $templateText = str_replace($matches[0], '', $templateText);
          }
  
          if (preg_match('/&lt;!--@vars\s*((?:.)*?)\s*@--&gt;/us', $templateText, $matches)) {
              $this-&gt;setData('orig_template_variables', str_replace("\n", '', $matches[1]));
              $templateText = str_replace($matches[0], '', $templateText);
          }
  
          if (preg_match('/&lt;!--@styles\s*(.*?)\s*@--&gt;/s', $templateText, $matches)) {
             $this-&gt;setTemplateStyles($matches[1]);
             $templateText = str_replace($matches[0], '', $templateText);
          }
  
          /**
           * Remove comment lines
           */
          $templateText = preg_replace('#\{\*.*\*\}#suU', '', $templateText);
  
          $this-&gt;setTemplateText($templateText);
          $this-&gt;setId($templateId);
  
          return $this;
      }
  
      /**
       * Retrive default templates from config
       *
       * @return array
       */
      static public function getDefaultTemplates()
      {
          if(is_null(self::$_defaultTemplates)) {
              self::$_defaultTemplates = Mage::getConfig()-&gt;getNode(self::XML_PATH_TEMPLATE_EMAIL)-&gt;asArray();
          }
  
          return self::$_defaultTemplates;
      }
  
      /**
       * Retrive default templates as options array
       *
       * @return array
       */
      static public function getDefaultTemplatesAsOptionsArray()
      {
          $options = array(
              array('value'=&gt;'', 'label'=&gt; '')
          );
  
          $idLabel = array();
          foreach (self::getDefaultTemplates() as $templateId =&gt; $row) {
              if (isset($row['@']) &amp;&amp; isset($row['@']['module'])) {
                  $module = $row['@']['module'];
              } else {
                  $module = 'adminhtml';
              }
              $idLabel[$templateId] = Mage::helper($module)-&gt;__($row['label']);
          }
          asort($idLabel);
          foreach ($idLabel as $templateId =&gt; $label) {
              $options[] = array('value' =&gt; $templateId, 'label' =&gt; $label);
          }
  
          return $options;
      }
  
      /**
       * Return template id
       * return int|null
       */
      public function getId()
      {
          return $this-&gt;getTemplateId();
      }
  
      /**
       * Set id of template
       * @param int $value
       */
      public function setId($value)
      {
          return $this-&gt;setTemplateId($value);
      }
  
      /**
       * Return true if this template can be used for sending queue as main template
       *
       * @return boolean
       */
      public function isValidForSend()
      {
          return !Mage::getStoreConfigFlag('system/smtp/disable')
              &amp;&amp; $this-&gt;getSenderName()
              &amp;&amp; $this-&gt;getSenderEmail()
              &amp;&amp; $this-&gt;getTemplateSubject();
      }
  
      /**
       * Getter for template type
       *
       * @return int|string
       */
      public function getType(){
          return $this-&gt;getTemplateType();
      }
  
      /**
       * Process email template code
       *
       * @param   array $variables
       * @return  string
       */
      public function getProcessedTemplate(array $variables = array())
      {
          $processor = $this-&gt;getTemplateFilter();
          $processor-&gt;setUseSessionInUrl(false)
              -&gt;setPlainTemplateMode($this-&gt;isPlain());
  
          if (!$this-&gt;_preprocessFlag) {
              $variables['this'] = $this;
          }
  
          if (isset($variables['subscriber']) &amp;&amp; ($variables['subscriber'] instanceof Mage_Newsletter_Model_Subscriber)) {
              $processor-&gt;setStoreId($variables['subscriber']-&gt;getStoreId());
          }
  
          // Apply design config so that all subsequent code will run within the context of the correct store
          $this-&gt;_applyDesignConfig();
  
          // Populate the variables array with store, store info, logo, etc. variables
          $variables = $this-&gt;_addEmailVariables($variables, $processor-&gt;getStoreId());
  
          $processor
              -&gt;setTemplateProcessor(array($this, 'getTemplateByConfigPath'))
              -&gt;setIncludeProcessor(array($this, 'getInclude'))
              -&gt;setVariables($variables);
  
          try {
              // Filter the template text so that all HTML content will be present
              $result = $processor-&gt;filter($this-&gt;getTemplateText());
              // If the {{inlinecss file=""}} directive was included in the template, grab filename to use for inlining
              $this-&gt;setInlineCssFile($processor-&gt;getInlineCssFile());
              // Now that all HTML has been assembled, run email through CSS inlining process
              $processedResult = $this-&gt;getPreparedTemplateText($result);
          }
          catch (Exception $e)   {
              $this-&gt;_cancelDesignConfig();
              throw $e;
          }
          $this-&gt;_cancelDesignConfig();
          return $processedResult;
      }
  
      /**
       * Makes additional text preparations for HTML templates
       *
       * @return string
       */
      /**
       * @param null $html
       * @return null|string
       */
      public function getPreparedTemplateText($html = null)
      {
  
          if ($this-&gt;isPlain() &amp;&amp; $html) {
              return $html;
          } elseif ($this-&gt;isPlain()) {
              return $this-&gt;getTemplateText();
          }
  
          return $this-&gt;_applyInlineCss($html);
      }
  
      /**
       * Get template code for include directive
       *
       * @param   string $template
       * @param   array $variables
       * @return  string
       */
      public function getInclude($template, array $variables)
      {
          $thisClass = __CLASS__;
          $includeTemplate = new $thisClass();
  
          $includeTemplate-&gt;loadByCode($template);
  
          return $includeTemplate-&gt;getProcessedTemplate($variables);
      }
  
      /**
       * Send mail to recipient
       *
       * @param   array|string       $email        E-mail(s)
       * @param   array|string|null  $name         receiver name(s)
       * @param   array              $variables    template variables
       * @return  boolean
       **/
      public function send($email, $name = null, array $variables = array())
      {
          if (!$this-&gt;isValidForSend()) {
              Mage::logException(new Exception('This letter cannot be sent.')); // translation is intentionally omitted
              return false;
          }
  
          $emails = array_values((array)$email);
          $names = is_array($name) ? $name : (array)$name;
          $names = array_values($names);
          foreach ($emails as $key =&gt; $email) {
              if (!isset($names[$key])) {
                  $names[$key] = substr($email, 0, strpos($email, '@'));
              }
          }
  
          $variables['email'] = reset($emails);
          $variables['name'] = reset($names);
  
          $this-&gt;setUseAbsoluteLinks(true);
          $text = $this-&gt;getProcessedTemplate($variables, true);
          $subject = $this-&gt;getProcessedTemplateSubject($variables);
  
          $setReturnPath = Mage::getStoreConfig(self::XML_PATH_SENDING_SET_RETURN_PATH);
          switch ($setReturnPath) {
              case 1:
                  $returnPathEmail = $this-&gt;getSenderEmail();
                  break;
              case 2:
                  $returnPathEmail = Mage::getStoreConfig(self::XML_PATH_SENDING_RETURN_PATH_EMAIL);
                  break;
              default:
                  $returnPathEmail = null;
                  break;
          }
  
          if ($this-&gt;hasQueue() &amp;&amp; $this-&gt;getQueue() instanceof Mage_Core_Model_Email_Queue) {
              /** @var $emailQueue Mage_Core_Model_Email_Queue */
              $emailQueue = $this-&gt;getQueue();
              $emailQueue-&gt;setMessageBody($text);
              $emailQueue-&gt;setMessageParameters(array(
                      'subject'           =&gt; $subject,
                      'return_path_email' =&gt; $returnPathEmail,
                      'is_plain'          =&gt; $this-&gt;isPlain(),
                      'from_email'        =&gt; $this-&gt;getSenderEmail(),
                      'from_name'         =&gt; $this-&gt;getSenderName(),
                      'reply_to'          =&gt; $this-&gt;getMail()-&gt;getReplyTo(),
                      'return_to'         =&gt; $this-&gt;getMail()-&gt;getReturnPath(),
                  ))
                  -&gt;addRecipients($emails, $names, Mage_Core_Model_Email_Queue::EMAIL_TYPE_TO)
                  -&gt;addRecipients($this-&gt;_bccEmails, array(), Mage_Core_Model_Email_Queue::EMAIL_TYPE_BCC);
              $emailQueue-&gt;addMessageToQueue();
  
              return true;
          }
  
          ini_set('SMTP', Mage::getStoreConfig('system/smtp/host'));
          ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port'));
  
          $mail = $this-&gt;getMail();
  
          if ($returnPathEmail !== null) {
              $mailTransport = new Zend_Mail_Transport_Sendmail("-f".$returnPathEmail);
              Zend_Mail::setDefaultTransport($mailTransport);
          }
  
          foreach ($emails as $key =&gt; $email) {
              $mail-&gt;addTo($email, '=?utf-8?B?' . base64_encode($names[$key]) . '?=');
          }
  
          if ($this-&gt;isPlain()) {
              $mail-&gt;setBodyText($text);
          } else {
              $mail-&gt;setBodyHTML($text);
          }
  
          $mail-&gt;setSubject('=?utf-8?B?' . base64_encode($subject) . '?=');
          $mail-&gt;setFrom($this-&gt;getSenderEmail(), $this-&gt;getSenderName());
  
          try {
              $mail-&gt;send();
              $this-&gt;_mail = null;
          }
          catch (Exception $e) {
              $this-&gt;_mail = null;
              Mage::logException($e);
              return false;
          }
  
          return true;
      }
  
      /**
       * Send transactional email to recipient
       *
       * @param   int $templateId
       * @param   string|array $sender sender information, can be declared as part of config path
       * @param   string $email recipient email
       * @param   string $name recipient name
       * @param   array $vars variables which can be used in template
       * @param   int|null $storeId
       *
       * @throws Mage_Core_Exception
       *
       * @return  Mage_Core_Model_Email_Template
       */
      public function sendTransactional($templateId, $sender, $email, $name, $vars=array(), $storeId=null)
      {
          $this-&gt;setSentSuccess(false);
          if (($storeId === null) &amp;&amp; $this-&gt;getDesignConfig()-&gt;getStore()) {
              $storeId = $this-&gt;getDesignConfig()-&gt;getStore();
          }
  
          if (is_numeric($templateId)) {
              $queue = $this-&gt;getQueue();
              $this-&gt;load($templateId);
              $this-&gt;setQueue($queue);
          } else {
              $localeCode = Mage::getStoreConfig('general/locale/code', $storeId);
              $this-&gt;loadDefault($templateId, $localeCode);
          }
  
          if (!$this-&gt;getId()) {
              throw Mage::exception('Mage_Core', Mage::helper('core')-&gt;__('Invalid transactional email code: %s', $templateId));
          }
  
          if (!is_array($sender)) {
              $this-&gt;setSenderName(Mage::getStoreConfig('trans_email/ident_' . $sender . '/name', $storeId));
              $this-&gt;setSenderEmail(Mage::getStoreConfig('trans_email/ident_' . $sender . '/email', $storeId));
          } else {
              $this-&gt;setSenderName($sender['name']);
              $this-&gt;setSenderEmail($sender['email']);
          }
  
          if (!isset($vars['store'])) {
              $vars['store'] = Mage::app()-&gt;getStore($storeId);
          }
          $this-&gt;setSentSuccess($this-&gt;send($email, $name, $vars));
          return $this;
      }
  
      /**
       * Process email subject
       *
       * @param   array $variables
       * @return  string
       */
      public function getProcessedTemplateSubject(array $variables)
      {
          $processor = $this-&gt;getTemplateFilter();
  
          if(!$this-&gt;_preprocessFlag) {
              $variables['this'] = $this;
          }
  
          $processor-&gt;setVariables($variables);
  
          $this-&gt;_applyDesignConfig();
          try{
              $processedResult = $processor-&gt;filter($this-&gt;getTemplateSubject());
          }
          catch (Exception $e) {
              $this-&gt;_cancelDesignConfig();
              throw $e;
          }
          $this-&gt;_cancelDesignConfig();
          return $processedResult;
      }
  
      public function addBcc($bcc)
      {
          if (is_array($bcc)) {
              foreach ($bcc as $email) {
                  $this-&gt;_bccEmails[] = $email;
                  $this-&gt;getMail()-&gt;addBcc($email);
              }
          }
          elseif ($bcc) {
              $this-&gt;_bccEmails[] = $bcc;
              $this-&gt;getMail()-&gt;addBcc($bcc);
          }
          return $this;
      }
  
      /**
       * Set Return Path
       *
       * @param string $email
       * @return Mage_Core_Model_Email_Template
       */
      public  function setReturnPath($email)
      {
          $this-&gt;getMail()-&gt;setReturnPath($email);
          return $this;
      }
  
      /**
       * Add Reply-To header
       *
       * @param string $email
       * @return Mage_Core_Model_Email_Template
       */
      public function setReplyTo($email)
      {
          $this-&gt;getMail()-&gt;setReplyTo($email);
          return $this;
      }
  
      /**
       * Parse variables string into array of variables
       *
       * @param string $variablesString
       * @return array
       */
      protected function _parseVariablesString($variablesString)
      {
          $variables = array();
          if ($variablesString &amp;&amp; is_string($variablesString)) {
              $variablesString = str_replace("\n", '', $variablesString);
              $variables = Zend_Json::decode($variablesString);
          }
          return $variables;
      }
  
      /**
       * Retrieve option array of variables
       *
       * @param boolean $withGroup if true wrap variable options in group
       * @return array
       */
      public function getVariablesOptionArray($withGroup = false)
      {
          $optionArray = array();
          $variables = $this-&gt;_parseVariablesString($this-&gt;getData('orig_template_variables'));
          if ($variables) {
              foreach ($variables as $value =&gt; $label) {
                  $optionArray[] = array(
                      'value' =&gt; '{{' . $value . '}}',
                      'label' =&gt; Mage::helper('core')-&gt;__('%s', $label)
                  );
              }
              if ($withGroup) {
                  $optionArray = array(
                      'label' =&gt; Mage::helper('core')-&gt;__('Template Variables'),
                      'value' =&gt; $optionArray
                  );
              }
          }
          return $optionArray;
      }
  
      /**
       * Validate email template code
       *
       * @return Mage_Core_Model_Email_Template
       */
      protected function _beforeSave()
      {
          $code = $this-&gt;getTemplateCode();
          if (empty($code)) {
              Mage::throwException(Mage::helper('core')-&gt;__('The template Name must not be empty.'));
          }
          if($this-&gt;_getResource()-&gt;checkCodeUsage($this)) {
              Mage::throwException(Mage::helper('core')-&gt;__('Duplicate Of Template Name'));
          }
          return parent::_beforeSave();
      }
  }
  </code></pre>
  
  <p>cron log:</p>
  
  <pre><code>2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "aoescheduler_heartbeat" at "2016-06-13 12:10" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "aoescheduler_heartbeat" at "2016-06-13 12:15" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "captcha_delete_expired_images" at "2016-06-13 12:10" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:06" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:07" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:08" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:09" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:10" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:11" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:12" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:13" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:14" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:15" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:16" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:17" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:18" already exists 1 times. Skipping.
  2016-06-13T12:05:07+00:00 DEBUG (7): Pending schedule for "core_email_queue_send_all" at "2016-06-13 12:19" already exists 1 times. Skipping.
  </code></pre>
  
  <p>system log:</p>
  
  <pre><code>2016-01-29T18:00:27+00:00 DEBUG (7): SQLSTATE[HY000] [1040] Too many connections
  2016-01-29T18:00:50+00:00 DEBUG (7): SQLSTATE[HY000] [1040] Too many connections
  2016-02-18T20:25:02+00:00 ERR (3): Warning: PDO::__construct(): MySQL server has gone away  in /home/username/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 129
  2016-02-18T20:25:02+00:00 ERR (3): Warning: PDO::__construct(): Error while reading greeting packet. PID=22  in /home/username/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 129
  2016-03-24T07:10:40+00:00 ERR (3): Warning: PDOStatement::execute(): MySQL server has gone away  in /home/username/public_html/lib/Zend/Db/Statement/Pdo.php on line 228
  2016-03-24T07:10:40+00:00 ERR (3): Warning: PDOStatement::execute(): Error reading result set's header  in /home/username/public_html/lib/Zend/Db/Statement/Pdo.php on line 228
  2016-03-24T07:10:40+00:00 ERR (3): Warning: PDOStatement::execute(): MySQL server has gone away  in /home/username/public_html/lib/Zend/Db/Statement/Pdo.php on line 228
  2016-03-24T07:10:40+00:00 ERR (3): Warning: PDOStatement::execute(): Error reading result set's header  in /home/username/public_html/lib/Zend/Db/Statement/Pdo.php on line 228
  2016-03-31T03:13:08+00:00 ERR (3): Warning: PDOStatement::execute(): MySQL server has gone away  in /home/username/public_html/lib/Zend/Db/Statement/Pdo.php on line 228
  2016-03-31T03:13:08+00:00 ERR (3): Warning: PDOStatement::execute(): Error reading result set's header  in /home/username/public_html/lib/Zend/Db/Statement/Pdo.php on line 228
  2016-03-31T03:13:08+00:00 ERR (3): Warning: PDOStatement::execute(): MySQL server has gone away  in /home/username/public_html/lib/Zend/Db/Statement/Pdo.php on line 228
  2016-03-31T03:13:08+00:00 ERR (3): Warning: PDOStatement::execute(): Error reading result set's header  in /home/username/public_html/lib/Zend/Db/Statement/Pdo.php on line 228
  2016-04-01T11:11:21+00:00 DEBUG (7): SQLSTATE[HY000] [2002] No such file or directory
  </code></pre>
  
  <p>Theres a load of errors in system.log for a store locator im using, but can't imagine that is linked to this issue.</p>