Thumbnail Generation PHP Memory Limit NextGEN Gallery
Source: Visser Labs Blog
When uploading a set of admittedly large images using NextGEN Gallery to my WordPress site I exceeded my web hosts default memory usage allocation for PHP applications. The error was:
Follow thumbnails could not created. sample.jpg (Error : Exceed Memory limit. Require : 80.65 MByte)
This issue can be resolved by increasing the memory usage allocation at a per-plugin level for PHP applications that require more grunt than others. It’s quick and easy!
- Open an FTP connection to your root WordPress directory
- Open
/wp-content/plugins/nextgen-gallery/lib/gd.thumbnail.inc.php
with your favourite text editor (e.g. UltraEdit, etc.) - On line #168 un-comment (remove the
//
) from before@ini_set('memory_limit', '128M');
- Save and upload changes
- Delete image/s that failed to generate a thumbnail and re-upload using NextGEN Gallery’s standard Upload Images feature
If you find 128MB is too ‘conservative’ this can be increased again to any figure of your liking, I find 128MB appropriate for most commercial and personal usage but if you’re a HD photographer then you’re going to hit this limit very quickly… that’s it!