V
V
Vladimir2017-04-19 11:17:48
PHP
Vladimir, 2017-04-19 11:17:48

How to solve out of memory error in Joomla?

Hello. I have an image upload plugin jw_sigpro
Added photos and pages started crashing with 500 error.
Logs:
Allowed memory size of 52428800 bytes exhausted (tried to allocate 13056 bytes) in /var/www/site/data/www/site/plugins/content/jw_sigpro/jw_sigpro/includes/helper.php on line 266

switch($type)
{
  case 1 :
    $source = @ imagecreatefromgif($original);
    if (!$source)
    {
      JError::raiseNotice('', JText::_('JW_SIGP_LABELS_06'));
      return;
    }
    break;
  case 2 :
    $source = imagecreatefromjpeg($original); ----266 строка
    break;
  case 3 :
    $source = imagecreatefrompng($original);
    break;
  default :
    $source = NULL;
}

// Bail out if the image resource is not OK
if (!$source)
{
  JError::raiseNotice('', JText::_('JW_SIGP_LABELS_07'));
  return;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-04-19
Portev @Vladimir Portev

Photo manipulation is a resource-intensive task. So either add RAM to the hosting or change the driver used. For example, if GD is used, you can change to Imagick and win decently.
You can also refuse to resize photos or set a limit on the size of uploaded photos. But you have 50mb - this is not enough, joomla itself eats a lot, and then there's resize and everything is 50mb.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question