NextGen Gallery: upload_max_filesize

The fabulous NextGen Gallery was maxing (timing) out when uploading zip files. My server said it could only handle 2 MB uploads, so I went searching.

Most help said to make changes to the .htaccess file, but I did that and I think my host has something set up (suexec or something) that doesn’t allow such code in there, so it said to create a php.ini file with the following code:

  1. post_max_size = 50M
  2. upload_max_filesize = 40M
  3. max_execution_time = 900
  4. memory_limit = 30M

Did that and put it in the root directory with no luck. Someone else said to put it in the directory where the script was, so I put it in the NextGen Gallery folder. Nope. Put it in ALL of the NG folders. Nope. Finally, seeing the WP plugin in action, I put the php.ini file in the /wp-admin/ folder and voila!

Also, when making the php.ini file, I used the code above, not the one with “php” in the directives. Those were for the .htaccess file.

, , ,

51 Responses to NextGen Gallery: upload_max_filesize

  1. Jim July 26, 2008 at 6:52 pm #

    Very accurate post!!! Thanks so much.

    I had to increase memory_limit above 30M so a thumbnail could get created for a 3.5mb picture. I set it to 100M just cuz I did not want to spend time tweaking exactly.

    Thanks again!

  2. Jim July 26, 2008 at 6:53 pm #

    We also have to remember to watch this php.ini file during an upgrade.

  3. webweaver August 4, 2008 at 12:00 am #

    I’m having the exact same problem, and have probably trawled my way through all the same places as you have to find the answer.

    I found an alternative solution here http://wordpress.org/support/topic/179176 – see staceppa’s comment at the end of the thread – which works for most of my files but not the very largest ones, even if I increase the value from 48M to 100M.

    So I figure now it’s time to try your solution. I need a bit of help though.

    What do I use to make the php.ini file? Is Dreamweaver OK? What format should it save itself as? Mine has saved as a plain text document. Is this OK?

    Do I need the numbers from your code above, or do I leave those out?

    If I add the file to the /wp-admin/ folder as you suggest, am I likely to be overwriting the original php.ini file (which isn’t listed as a file there but which I’m worried might be hidden or something.)

    Thanks heaps

    :)

  4. MeiaLua August 4, 2008 at 9:34 am #

    Splendid, this worked liek a charm for my zipped jpg archive! Thxs!

  5. pr'muts September 3, 2008 at 5:16 pm #

    i’m having the same problems as webweaver and they aren’t solved by either two solutions (http://wordpress.org/support/topic/179176 – and this one).

    Just to be sure: do I have to add [PHP] as first line in the php.ini?

    And… when uploading a pic ngallery says “Note : The upload limit on your server is 8MByte”. Then the actual pic is saved but the thumbnail isn’t.

    So help!

  6. Bradley Charbonneau September 9, 2008 at 10:59 pm #

    webweaver: I just used Notepad (on WIN) to make the php.ini file. You don’t want to use something like Word that will put extra code in there. But then it does seem to save it as a .txt file. I don’t really know how to change that other than using a simple file folder system and I changed the .txt to .ini (I used FileZilla as it shows files with their real extensions and you can just change them).

    Leave the numbers out, I think they’re just for show here on this site.

    I didn’t see a php.ini file in the wp-admin folder, but if there is one, maybe rename it something else (php_original.ini) and then upload your php.ini file. But I don’t think I had a php.ini file in that folder.

    I hope that helps!

  7. Bradley Charbonneau September 9, 2008 at 10:59 pm #

    pr’muts: No, I don’t think you have to add [PHP] in the php.ini file, just the text up there in the code (without the line numbers).

  8. Bradley Charbonneau September 9, 2008 at 11:01 pm #

    Jim: You’re absolutely right and I’m sure it’s something I’d forget and then wonder why the limits were back to where they were! Always good to backup, of course. I’ve been using WP’s new automated upgrade plugin quite a bit and loving it. I wonder if it deletes all folders (well, the wp-admin etc. folders) and the uploads the new versions or if it keeps files it doesn’t recognize. I guess we’ll find out …

    Thanks for posting, Jim.

  9. Ante Logarusic September 30, 2008 at 7:45 am #

    Thanks a million for this you guys. I’ve been tearing my hair out trying to fix this glitch for my clients.

  10. Laura Schatzkin October 14, 2008 at 9:15 pm #

    Thanks, pal, for doing the research for me and saving me hours of aggravation — hours I just don’t have right now. You’re the best.

  11. Mike Masi October 30, 2008 at 4:09 pm #

    Perfect! Thanks!
    Mike

  12. Kurotsuki November 6, 2008 at 11:27 am #

    THANK YOU SOOOOO MUCH ! I have been looking for a solution to this problem for more than 3 months and now, thanks to you, I finally succeeded ! You’re my hero ! xD

  13. Tony Zeoli November 8, 2008 at 6:03 pm #

    Just found this solution after looking for months. I guess you’re rising in the Google search rankings. This definitely worked for me without having to do anything else. I added the parameters to the php.ini file, dumped it into wp-admin and it worked like a charm. Thanks! Someone should now write this as a plug-in.

  14. Irina November 28, 2008 at 5:23 am #

    Awesome! Creating this php.ini file really did the trick for me! Thank you for sharing.

    I guess it’s not always about the upload size (mine was 64MB preset, so shouldn’t have been a problem here), maybe it’s the time out thingy that’s causing problems with the zip upload.

    Anyway, it’s working perfectly now!

    (Leave the numbers out in the code, they don’t belong in the ini-file. Also the file must be named php.INI, not .txt or .doc or anything, you can change file extensions in your FTP program or setup your Windows Explorer to show file extensions, just google it if you don’t know how to activate this feature).

    Good luck to everyone out there having the same problem! :)

  15. Rafael December 1, 2008 at 5:56 pm #

    I’m still having the same problem and nothing seems to work. I fixed the download limit, but the memory limit still an issue and I do not know what to do to fix it. I tried everything here.

  16. BirminghamIU December 7, 2008 at 5:29 am #

    I am attempting this fix now it’s 12:30 in the afternoon (British UK time) and i have been up since 6:00pm last night trying to fix this problem. I hope this works. I’ll keep you posted. Thanks!

  17. BirminghamIU December 7, 2008 at 5:32 am #

    Been going for five minutes now longer than usual so who knows it might work fingewrs crossed X

  18. BirminghamIU December 7, 2008 at 5:38 am #

    There seems to be alot of conffusion about how to create this file so i have added it to my server as a download. Please goto the link below and download the .rar file.

    Unzip the rar archive and the php.ini file is contained within. All that’s needed is to upload to the required directory.

    I thought I would share it as people kindly let me know what i needed in the first place. Hope this helps someone.

    http://astralprojectionuk.site88.net//phpdownload/php.rar

  19. BirminghamIU December 7, 2008 at 5:39 am #

    CORRECT DOWNLOAD LINK I ADDED A SECOND / BY ACCIDENT! OOOPS! SORRY HERE IS THE LINK AGAIN! LOL!

    http://astralprojectionuk.site88.net/phpdownload/php.rar

  20. BirminghamIU December 7, 2008 at 5:40 am #

    I think this has fixed my problem it appears to work perfect. Thank you.

  21. Lori Burgard December 14, 2008 at 11:48 am #

    THANK YOU!! I’ve searched for hours and kept trying different directories as well.

  22. LordCrap February 6, 2009 at 2:18 pm #

    Sweet, thanks a lot, I’ve been pulling hair over this for some time now!

  23. rhoen February 6, 2009 at 6:25 pm #

    perfect tutorial! thanks a zillion!

  24. chris March 12, 2009 at 9:42 pm #

    hello! so this was great to find– and i made the /ini file and uploaded it — and the uploader appeared to be working until the very end — when it gives an “HTTP error” any ideas?

  25. florence professional firefighters April 25, 2009 at 8:03 am #

    thank you!

    i have been messing around with trying to get this plugin to work right for a couple of months now, and this simple “fix” and easy to understand directions has finally fixed my problems!

    Now my thumbnails are working and I’m not getting those crazy memory errors any more!

    Thank you again!

  26. costume jewelry June 15, 2009 at 4:16 am #

    Fantastic post, I am a big fan of NextGen Gallery, so I am very happy to read this post. I found your blog a few days ago on Technorati and have been reading it over the past few days.

  27. Antalya Evden Eve Nakliyat June 17, 2009 at 8:50 pm #

    THANK YOU!! I’ve searched for hours and kept trying different directories as

  28. John June 29, 2009 at 6:40 pm #

    THANK YOU. I’ve also been searching for quite some time between different sites. This is the only solution that has worked.

  29. Dan September 5, 2009 at 5:30 am #

    Finally a solution to this plugin, thanks a bunch Bradley, this really did the trick.

  30. Mike September 7, 2009 at 2:38 pm #

    Thanks, not sure if I would of figured this one out w/o ya.

  31. discount electronics September 12, 2009 at 9:28 pm #

    Very usefull tips for “upload file” in PHP. Thanks!

  32. aaa November 22, 2009 at 7:55 am #

    doesnt work for me :/

  33. DavidM November 29, 2009 at 8:52 pm #

    Thanks much for this one. I read through so many articles trying to resolve this. No one mentioned to put the php.ini file in wp-admin. Good troubleshooting.

  34. John November 30, 2009 at 8:43 am #

    I did exactly as the tutorial said. Created a php.ini, put the code in (without the numbers 1,2,3,4) saved & uploaded to wp-admin and it still doesn’t work for me.

  35. gelo December 14, 2009 at 4:24 am #

    Thanks, this works also for problems uploading images bigger than 2MB.

  36. Ian February 25, 2010 at 5:13 pm #

    Thanks so much for the tip; I had my .ini file in all the logical places. Who would have thought the plugin was set to read the one in the wp-admin folder. Thanks for your post!

  37. impulse October 15, 2010 at 12:27 pm #

    Thanks! that worked for me, no more strange errors about memory. I am hosted at strato.

  38. eserve February 2, 2011 at 5:58 pm #

    Thanks! You saved me hours.

  39. Ben April 23, 2011 at 10:09 am #

    Thanks! I ran into this, and I know this is old, but it worked perfectly. Saved me a ton of headaches

  40. affordable legal fees April 28, 2011 at 10:11 pm #

    Thanks, found your post after tying everything under the sun. Just dropped php.ini in wp admin folder and now everything works perfect, wish i would have found this post sooner…

  41. Pam June 8, 2011 at 6:50 pm #

    Hello Bradley,
    Thanks for sharing this. It would really helps.
    Pam recently posted … Bay Window Curtain Rods

  42. Mel June 29, 2011 at 2:34 am #

    Hi,

    this worked for me:

    Edit nextgen-gallery/lib/gd.thumbnail.inc.php

    Find the line that says:
    // @ini_set(‘memory_limit’, ’128M’);

    Remove the // to uncomment the line.

    Beneath that add:

    @ini_set(‘post_max_size’, ’128M’);
    @ini_set(‘upload_max_filesize’, ’128M’);

    You would just need to watch out for this when you upgrade the plugin.

    Cheers :)

  43. nik August 25, 2011 at 9:19 am #

    hi !

    using nextgen public uploader i experience the following:

    after successfully uploading a photo the browser refreshes the page but the pic isn’t displayed.
    when manually reloading the pic gets uploaded again and after that the first upload can be seen . . .

    any ideas to this ?

    every browser and wpms

    thanks :)

  44. luis August 22, 2012 at 8:18 am #

    Thank you! I tried everything but only that solution worked for me. Thank you so much.
    luis recently posted … Milton de Oliveira

  45. Ashish March 24, 2013 at 12:11 am #

    I want to code one PHP script which allows me to generate thumbs of given images with specified dimensions and names as per Next-Gen Gallery Plugin of WordPress.

    I have website for cover pages: http://facebook4free.com/

    Thumb Gallery Page: http://facebook4free.com/category/facebook-cover-pages/abstract-facebook-cover-pages-facebook-cover-pages/

    Main Image Page: http://facebook4free.com/abstract-cover-pages-for-facebook-profile-2/facebook-images/image/1-cover-photo-82140/

    Issue is timeout when I upload images in wordpress plugin. It uploads images in create their thumbs but when I upload more than 10 images it fails. So I want to separately create PHP script which create thumbnails of my FB cover pages with given dimensions and specified name (a pattern).
    Many of the images are in .jpg, .png formats but all are having dimensions of 851×315.
    Any help would be appreciated.

  46. Do September 30, 2013 at 5:46 am #

    Very good! Really this is a different plugin for WP. Its structure in HTML and JS is well organized and helps us a lot with a great interface! Thank you!

Trackbacks/Pingbacks

  1. NextGen Gallery upload max filesize Likoma | Menopause Relief - June 8, 2009

    [...] NextGen Gallery upload max filesize Likoma Posted by root 5 minutes ago (http://www.likoma.com) Hot flashes sexy stories 96186 views using google apps email for i found an alternative solution here http wordpress org support topic 179176 see staceppa comment at the end time and i have been up since 6 00pm last night trying to fix this problem copyri Discuss  |  Bury |  News | NextGen Gallery upload max filesize Likoma [...]

  2. NextGEN Gallery Maximum 300 Big Images « Ivan Teoh - July 7, 2009

    [...] NextGen Gallery: upload_max_filesize [...]

  3. NextGen Gallery: upload_max_filesize | Likoma | My Web Development Bookmarks - October 17, 2009

    [...] Read this article: NextGen Gallery: upload_max_filesize | Likoma [...]

  4. Øg maximum upload filstørrelse på 2 mb i Wordpress - March 22, 2010

    [...] Likoma.com Billeder, Brugervenlighed, Filstørrelser, PHP, php.ini, [...]

Leave a Reply


two − 1 =

CommentLuv badge

css.php