[wp-trac] [WordPress Trac] #52143: memory_limit not always adhered

WordPress Trac noreply at wordpress.org
Thu Jan 7 11:02:11 UTC 2021


#52143: memory_limit not always adhered
-------------------------------+------------------------------
 Reporter:  danielbareman      |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:  5.6
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  performance
-------------------------------+------------------------------

Comment (by danielbareman):

 Hello @mikeschroder

 First of all, thanks for you're reply and looking into this.

 The reason behind my suggestion is that I work at a technical help desk of
 a dutch hosting company.

 We get some customers asking if they can get their memory increased as it
 only shows 40Mb, which means it defaults to when the other if's don't
 succeed: https://github.com/WordPress/wordpress-
 develop/blob/029dd1bbb929eec4df5f57789ef42c076aab83f0/src/wp-includes
 /default-constants.php#L47

 So initially it seems the line below doesn't work out.
 {{{
 if ( false === wp_is_ini_value_changeable( 'memory_limit' ) )
 }}}

 Which could be a specific thing caused by our hosting envoirement?
 I've just now looked into
 https://developer.wordpress.org/reference/functions/wp_is_ini_value_changeable/
 and did a test with "ini_get_all" which defaults in:
 {{{
 Array
 (
     [global_value] => 128M
     [local_value] => 128M
     [access] => 7
 )
 }}}

 Or with "php_value memory_limit 256M" in a ".htaccess"

 {{{
 Array
 (
     [global_value] => 128M
     [local_value] => 256M
     [access] => 7
 )
 }}}

 At least, after contact of a customer and by adding te line below to their
 "wp-config.php" it resolves and sets it to the value that's assigned by
 php.ini or altered with the help of a '.htaccess'.
 {{{
 define('WP_MEMORY_LIMIT', ini_get('memory_limit'));
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52143#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list