WebdesignWordpress

NextGEN gallery permissions image upload or thumbnail memory error

For any of you out there that have been looking for a fix for this issue with this WordPress plugin I have something you can try.  Took me all day to find this out but so glad I did.

I was getting permissions errors and memory allocation errors when I tried to upload images in NextGEN Gallery.  The error I was getting said.

Error, the file permissions could not be set

or maybe something like ‘couldn’t create thumbnails due to memory error’

I knew it wasn’t NextGEN that was causing the problem because I’d had the site up and working on my development machine.  After much fooling around I changed the permissions of the wp-content/gallery folder and all of it’s subfolders to 750 but still wasn’t working.  After digging around in the code for NextGEN I found that there was a PHP function that was causing the error to be shown called ‘chmod()’.  It turns out that it was returning false showing that there was a problem changing the permissions on the images which were uploaded to the server.  Anyway, turns out that there was a line in the php.ini file for this particular hosting company disabling the php function chmod().  Only after many long calls to the hosting company (ironically Easily.co.uk) which didn’t solve anything did I find the problem by manually looking through the php.ini file.

So here’s what you need to do to solve the issue.

  1. chmod -R your gallery folder to 750 (Changing the permissions for that folder and all of it’s subfolders to rwxr-x—) – if that doesn’t work maybe try 777 just for testing.
  2. go through your php.ini file, wherever it is for your hosting company and check that the line disable_functions = chmod is commented out with a ; before it.
  3. if you’re also getting a message saying that there’s not enough memory to make your thumbnails then check your php.ini file for the line memory_limit = 16M ; Maximum amount of memory a script may consume (16MB). You may need to increase to 32M or 64M like I did.

If this doesn’t work for you then it’s probably something else in your situation.  The other thing you should try is stopping the plugin and starting it again as I heard that helped for some users.

Hope you find this useful.  Please comment at the bottom if you do.

Cheers,

Rob

Leave a Reply

Your email address will not be published. Required fields are marked *