• Resolved justin-bigscoots

    (@justin-bigscoots)


    Looks like pretty-link.php is hard setting PHP memory_limit to 128MB which is effecting most of the install, example:

    PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /home/nginx/domains/domain.com/public/wp-includes/class-wpdb.php on line 2153

    even though:

    # php -i |grep memory_limit
    memory_limit => 2G => 2G
    

    even with wp config constant set.

    Quick example with WP CLI:

    # wp option get siteurl
    PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 10485760 bytes) in /home/nginx/domains/domain.com/public/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-backup.php on line 173
    

    and now the same command yet skipping pretty-link

    # wp option get siteurl --skip-plugins=pretty-link
    https://www.kitchenstewardship.com

    If I comment out the lines

    // Let's give pretty link plenty of room to work with
    $mem = abs(intval(@ini_get('memory_limit')));
    if($mem && $mem > 1 && $mem < 128) { //$mem = 1 is probably abs(-1), -1 means "unlimited"
    @ini_set('memory_limit', '128M');
    }

    Then everything is peachy

Viewing 5 replies - 1 through 5 (of 5 total)
  • Tyler

    (@tylerthedude)

    Hi Justin,

    If you uncomment that code and temporarily change your PHP memory_limit to something smaller than 1G but greater than 128MB (maybe something like 256MB), does that resolve the error?

    Kind regards,

    Thread Starter justin-bigscoots

    (@justin-bigscoots)

    It does indeed but some of these sites unfortunately require more than 1GB 🙂

    Tyler

    (@tylerthedude)

    Hi Justin,

    Thank you for trying that. I believe I know what’s causing the problem, so I’ll reach out to our development team and see about getting this fixed in a future release of Pretty Links.

    Kind regards,

    Thread Starter justin-bigscoots

    (@justin-bigscoots)

    Appreciate it, thank you!

    Tyler

    (@tylerthedude)

    Hi Justin,

    I just wanted to follow up and let you know that the latest version of Pretty Links (3.3.3) no longer overrides the site’s PHP memory_limit so this should no longer be a problem going forward.

    Kind regards,

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hard setting PHP memory limit to 128MB’ is closed to new replies.