SOLVED: My WordPress Thumbnails Stopped Thumbnailing

The server where I host this blog experienced some oddness and the web server daemon (httpd) had to be restarted.  Once it came back up and it was determined that the primary DNS server on which we rely had crapped out, we were able to point to another DNS server and things seemed to get back to normal.  With a few minor exceptions that is… most notably, thumbnails were no longer thumbnailing.

This WordPress theme uses a

TimThumb script created by Tim McDaniels and Darren Hoyt with tweaks by Ben Gillbanks

. To diagnose the problem, the first place I looked (like every good web administrator) is the logs.

[Wed Jul 14 05:41:11 2010] [error] [client xx.xx.xx.xx] PHP Fatal error:  Allowed memory size of 31457280 bytes exhausted (tried to allocate 12288 bytes) in /path/to/my/web/home/httpdocs/wp-content/themes/mytheme/thumb.php on line 271, referer:

AHA! The problem became obvious and easy to solve. The problem appears to be that the memory_limit value in the php configuration file (php.ini) has been set to low. Sure enough it was set to 4M.

A quick edit of the php.ini file…

; Resource Limits ;

max_execution_time = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60     ; Maximum amount of time each script may spend parsing request data
memory_limit = 48M      ; Maximum amount of memory a script may consume</pre>
And a quick restart of apache...
<pre>/etc/init.d/httpd graceful

and blam-o… we’re back in business…. thumbnail’s a thumb’n.

If you don’t have root permissions – or don’t have access to your own php.ini file, you may need to contact the support team where you host your web site. Questions? Comments?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s