While performing my normal web site maintenance on my client’s sites earlier this week, I came across a situation that brought me to a screeching halt. I was uploading photos into a new gallery, and during the upload process, noticed that the thumbnail creation was producing an unfamiliar error message.
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /public_html/wp-content/plugins/nextgen-gallery/lib/gd.thumbnail.inc.php on line 176
Fatal error: Out of memory (allocated 32505856) (tried to allocate 11264 bytes) in /wp-content/plugins/nextgen-gallery/lib/gd.thumbnail.inc.php on line 176
Having to troubleshoot issues like this is a part of my daily life, considering the number of sites that I maintain for my clients. I always start with the most common issues; verify that file permissions are correct, check .php code for issues due to recent updates, etc. When I get stuck, I move on to Google. Usually, searching for something like in this case, “gd.thumbnail.inc.php on line 176″, will bring up any discussion by people who have experienced similar issues. I found that this was a common enough issue, with not many solutions.
Note: In this case, you may think that your host should increase your memory limit due to the second error generated… some hosts don’t allow this, some may already have your limit set pretty high. Make sure you send your host ALL of the error messages you receive so they can help you more effectively. In this case, the memory limit message was a result of the first error and less relevant to finding the solution.
Once I read all the posts in the WordPress.org forums, I realized that the solutions that made the most sense to me all pointed to the host, rather than the scripts. After talking to my server guys for a short time, it was determined that rebuilding GD, it’s dependencies, and PHP was the only solution. [What is GD library?] Since this is not something I could do from my end of things, I waited patiently while staring at the “could not reach server” responses on my sites (apparently, rebuilding these code libraries requires taking the server down for a very short period of time) .
In this instance, rebuilding GD, it’s dependencies, and PHP did the trick. NextGEN Gallery started working the way it was supposed to, and all was right with the world. If you’re seeing similar issues with your WordPress plugins, you may want to consider skipping all the alterations to your core code as suggested in forums, and check with your host first.
Problems like this one are bound to happen occasionally, such is life on the Internet… this is only one reason that your relationship with your host is so important! I host all my client’s sites, and have a seven year strong relationship with the people that run my servers. If you’re not happy with your current host, and would like to stop worrying about issues as described above, contact me … maybe I can help make this one part of your work day run a little smoother. Remember that I’m only a phone call away using my consultation line!