WordPress.org

Ready to get started?Download WordPress

Forums

AJAX Thumbnail Rebuild
Error 500 solution (4 posts)

  1. kReEsTaL
    Member
    Posted 1 year ago #

    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.

    http://wordpress.org/extend/plugins/ajax-thumbnail-rebuild/

  2. Jason
    Member
    Posted 1 year ago #

    Note, this won't work if you are running suhosin as it prevents php scripts from adjusting memory limits.

  3. James Mehorter
    Member
    Posted 1 year ago #

    Thanks! That worked for me

  4. Krzysiek Dróżdż
    Member
    Posted 11 months ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic