Jump to content
Martin Wuehr

Upload Images on one Template doesn't work anymore | Not enough memory to load/resize

Recommended Posts

Hello everybody,

I'm hosting a Processwire Installation for a client. It runs on Processwire 2.5.3. Over the years everything was fine but now there is an issue with one Image-Field in one Template. Trying to upload an Image the Error "Not enough Memory to load/resize" occure. Other Image-Fields in all other Templates working without any issue. The Images I Tried to upload are very small (600px * 420px). The Images blongs to a News feed, and worked before.

I read about the problem in the forum but I can't get this solved. I have no access to the php.ini to modify the memory_limit.

I tried to update the Processwire Verion but failed. (Tried 2.7 /2.8 / 3.2) Got Always Internal Server Error and in the error Log: 

Compile Error:     Cannot redeclare PageEditFieldPermissionConfig()….

Has anybody any idea how I can get this solved?

Thank you so much



Share this post

Link to post
Share on other sites

try to increase the memory limit via .htaccess file

php_value memory_limit 256M

and check it by looking to the phpinfo() before you try to increase and afterwards, if it does take effect.

  • Like 1

Share this post

Link to post
Share on other sites

Thank you for your answers,

regarding to php info the Memory Limit is set to -1. So no Limit?

When I try to set the Limit via .htaccess to 256 a internal Server Error occure. the site is no longer reachable.

The strange thing is, other image fields in the Installation working just fine. These are also fields with bigger Image to load. So how can the php Limit an issue?

When integrating one of the other (working) Image fields in the template where the problem is, it's also not possible to upload an Image. So it's more a problem of the template?

Thank you



Share this post

Link to post
Share on other sites

What does the full error message say?
Are there any permissions set in that field or template or user?
Have you tried another image?
How large is your image - MB and pixels?
Can you switch to a more recent PHP version (your 5.6 seems a bit dusty)?

Also check upload_max_filesize and post_max_size.

Share this post

Link to post
Share on other sites


The error is: imagename - not enough memory to load / resize

There are permissions set for roles which have access to this template.

I tried other images too. All Image are small 640px * 480px with ~ 60kb - 80kb (jpg / 72dpi / rgb 8bit)

We can't upgrade the PHP Version here. (for complex reasons)

post_max_size and upload_max_filesize are 64M

The Image field was working fine. It belongs to a news feed. At one point it stoped working.


Share this post

Link to post
Share on other sites
9 minutes ago, Martin Wuehr said:

The Image field was working fine. It belongs to a news feed. At one point it stoped working.

Ok... well... I don't know. 

There are only a few things and thoughts left so far.

  1. check what has changed in the last days/weeks since it broke
  2. maybe GD or ImageMagick (don't know if this exists in 2.5.x) are failing
  3. ask the hosting company if there were any changes (security efforts, file scanners, whatever)
  4. remove any restrictions on that field
  5. use another browser
  6. use another user
  7. check console for errors
  8. check disk space

Last and final thought:

Make a backup, test it locally and take it apart.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By August
      Hi again, after trying pages2PDF, RockPDF and mpdf I'm not sure which of them I should use. Of course, there is also wirePDF.
      I merged mpdf with rockPDF, add a footer and a page in Landscape and that works, like in the code-snippet below but be am I on the right way?
      After that I tried a couple of times rendering an image. Nothing happend, the same with Pages2PDF too. I also copied an Image-URL within processwire and tried further getting an Image within the PDF-Document, but it still display only the red marked placeholder.
      I simply would like create an PDF on click from some Pages including the Images.
      Are there special requirements on Debian 10 with Apache and php 7.3 using Processwire 3.0.123.?
      Is there a guide that I didn't found?
      Is somebody out there who has a similar issue solved and would you be so kind to explain?
      $pdf = $modules->get('RockPdf'); $mpdf = $pdf->mpdf; # $mpdf->showImageErrors = true; $pdf->set('SetHeader', 'header text'); $mpdf->AddPage('L'); # $mpdf->Image(urlencode('site/assets/files/1845/image-2.275x200.jpg'), 0, 0, 210, 297, 'jpg', '', true, false); $pdf->set('SetFooter', ' <table width="100%"> <tr> <td width="33%">{DATE j.m.Y}</td>        <td width="33%" align="center">{PAGENO}/{nbpg}</td> <td width="33%" style="text-align: right;">whatever</td> </tr> </table>'); $pdf->show(); // generate pdf  
    • By Hardoman
      Hello community,
      we have a website running version 3.0.118. The owner would like to have a watermark merged to the images, that are being uploaded in the CKEditor as a requirement.
      Image upload besides the CKEditor within galleries and single images works as a charm already. We also use croppable image 3 there. (PIM2)
      To realize this requirement, I thought of using a hook in the admin area. So, I read a lot in our forums and tested this by adding a hook into the ready.php file.
      $this->addHookAfter('InputfieldFile::fileAdded',function(HookEvent$event){ wire('log')->save('test','Image upload works'); ... The log entry is being created correctly. But when I try to use the pim/watermark-function like in a template, he cannot find the watermark-image anymore. Furthermore, when I try to get the page-id, it does not seem to be accessible, because the application does not seem to know how to reference it, or I dont know the right way to do so…
      So my questions are:
      Is this the right attempt at all or will there be another, better workaround? It seems, I cannot access the page object (of the content page) within this scope or file but I would need it to save the processed image inside the right files/id folder Would it be better to place the hook into the admin-template? (or admin.php)
        Thanks for any hints in advance. 🙂
    • By toni
      I'm facing a strang problem. In my template I'm setting different sizes for srcset:
      $view->set('images', $page->picture); <img srcset="{$img->size(780,0)->url} 780w, {$img->size(1024,0)->url} 1024w, {$img->size(1440,0)->url} 1440w" src="{$img->url}" class="col__image"> All fine. However, the moment I reorder images in backend the different generated image sizes are broken.
      Does somebody has an idea what could cause it? 
      Version: ProcessWire 3.0.123 
    • By nabo
      I'm working on a project that use PW as backend CMS. PW serves formatted data of each page but the engine simply generates json from pagearray.
      I would like to set one or more variations on images, so I think it would be useful if there were a field to set possible variations... even with overrides!
    • By PawelGIX
      Can I convert uploaded images to PNG, GIF, BMP -> JPEG?
      Is there any function in the API that I can change the file type?
  • Create New...