Support » Plugin: AJAX Thumbnail Rebuild » [Plugin: AJAX Thumbnail Rebuild] Error 500 solution

  • Hello guys,

    I just wanted to share a solution I found to fix the error 500 problem, if like me you cannot edit the PHP memory limit of your hosting plan.

    Just add ini_set('memory_limit', '3000M'); at the beginning of your wp-config.php file, and it should work just fine !

    If for some reason you can’t edit your wp-config.php, just add it at the beginning of the plugin file (but you’ll have to do this after each plugin update).

    Hope this helps! Thanks to Mike for the fix.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Note, this won’t work if you are running suhosin as it prevents php scripts from adjusting memory limits.

    James Mehorter


    Thanks! That worked for me

    Well, sometimes changing memory limit is not possible.

    In my case I had to edit code of the plugin.

    On line 179 you can find:

    $attachments =& get_children( array(
    	'post_type' => 'attachment',
    	'post_mime_type' => 'image',
    	'numberposts' => -1,
    	'post_status' => null,
    	'post_parent' => null, // any parent
    	'output' => 'object',
    ) );

    Changing it to:

    $attachments = $wpdb->get_results("SELECT id, post_title FROM {$wpdb->posts} WHERE post_type='attachment' AND post_mime_type LIKE 'image%'");

    This query uses less memory, so there is pretty big chance it will work and won’t exceed memory limit.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: AJAX Thumbnail Rebuild] Error 500 solution’ is closed to new replies.