[wp-trac] [WordPress Trac] #49329: memory_limit in site health is not really correct, value is taken from wp_raise_memory_limit
WordPress Trac
noreply at wordpress.org
Sat May 23 17:12:55 UTC 2020
#49329: memory_limit in site health is not really correct, value is taken from
wp_raise_memory_limit
-------------------------------------------------+-------------------------
Reporter: espiat | Owner:
| SergeyBiryukov
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 5.5
Component: Site Health | Version: 5.3.2
Severity: normal | Resolution:
Keywords: needs-testing 2nd-opinion needs- | Focuses:
patch | administration
-------------------------------------------------+-------------------------
Comment (by zodiac1978):
After we raised the PHP limit to 5.6 we could use `ini_get_all`
(https://www.php.net/manual/de/function.ini-get-all.php) here, because
with PHP 5.3 came the DETAILS parameter and we get a global value and a
local value.
> When details is TRUE (default) the array will contain global_value (set
in php.ini), local_value (perhaps set with ini_set() or .htaccess), and
access (the access level).
`$ini_all[ 'memory_limit' ][ 'global_value' ]` is 128M in my case, which
is correct.
`$ini_all[ 'memory_limit' ][ 'local_value' ]` is whatever the user /
plugin or WordPress tried to use. In the WP admin context this should be
256M (or higher if available).
There is a workaround for PHP 5.2 which could be removed now I think:
https://github.com/WordPress/WordPress/blob/26bda18a23174afb048afbe62296c76a62add542
/wp-includes/load.php#L1330-L1333
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49329#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list