Fatal Error - appears that I have run out of PHP memory?

5 replies
I am making a Wordpress site. I have decided on using the NextGen Gallery plugin to make a photo gallery on my site. The photos I have are about 4500 X 3500 pixels, or 2800 X 1800 px (approx numbers). I have run into a fatal error, where my hosting site (hostgator) tells me that my PHP is all filled up and I have no more memory and cannot upload any more photos. The php memory on hostgator is already set to 64 MG. This is the fatal error: Fatal error: Out of memory (allocated 69206016) (tried to allocate 19008 bytes)

How do you get around this? Do I need to make my images smaller? I only know how to use Picnik to make my images smaller. Is there a way to make the images smaller very quickly without having to do each one manually with a program like Picnik? Maybe making my photos smaller will not make any difference? I need your expertise please. Thank you so much for your help.
#appears #error #fatal #fatal error #memory #nextgen gallery #php #run #wordpress
  • Profile picture of the author wpallstar
    Hi there, the problem is with the dimensions of the image.. not necessarliy its filesize. After you upload the image to the server, wordpress attempt to make thumbnails, for this it uses GD library, the image is somewhat uncompressed during this process and an image with large dimensions takes up a lot of space in memory when uncompressed..

    SImple answer is resize the images prior to upload...
    {{ DiscussionBoard.errors[4430039].message }}
  • Profile picture of the author Workman
    Originally Posted by Kim Phoenix View Post

    The php memory on hostgator is already set to 64 MG.
    64 MegaGigs?

    Originally Posted by Kim Phoenix View Post

    Do I need to make my images smaller? ... Is there a way to make the images smaller very quickly?
    There are two quick solutions -- You can either increase the memory limit or resize your images.

    The first depends on your host and if they will even let you set the memory limit to something else. Try putting this at the top of your script to increase it to 128 MB:
    ini_set('memory_limit','128M');
    Or if that doesn't work, create (or edit) a file called .htaccess in your webroot and put the following line in there:
    php_value memory_limit 128M
    If you're still experiencing the problem, your best bet is to just resize the images to something more manageable:

    If you're on Windows XP, Microsoft released a bulk image resize tool. Click here, then the "PowerToys" tab, then download the "Image Resizer". Once installed you just select the images you want to resize, right click on them, and select "Resize Images"

    Windows 7 users can download the Photo Gallery application directly from Microsoft which also supports bulk edits.

    Another option is to download Picasa from Google and resize images that way. It's a bit more overhead since it typically wants to scan your library and then you can do what you want.

    Good luck!
    {{ DiscussionBoard.errors[4433255].message }}
    • Profile picture of the author Kim Phoenix
      Thank you. I have Windows 7. I will start first by resizing my photos. I will then try to increase my memory size if I still need it later. Thanks again. I knew I should have resized my photos before I started, but I was crossing my fingers that I would not need to do it!
      Signature
      http://www.BuyHealthPLR.com (PLR Written & Edited by a Healthcare Professional)

      http://www.TheOnlineChick.com

      {{ DiscussionBoard.errors[4435443].message }}
  • Profile picture of the author mattprince789
    It had been applying phpAlbum for businesses photo gallery for quite some time now and every now and then They had run into a "Fatal error: Out of memory" error when scanning directories for pictures. Each time we had gained PHP memory limit in php.ini file as well as it has relieved the problem.
    {{ DiscussionBoard.errors[4450977].message }}

Trending Topics