The server is CentOS 6.8 with PHP 5.4.45.
# php -r 'echo ini_get("memory_limit")."\n";'
2G
This works the same with Ubuntu 14.04 and PHP 5.6.23
# php -r 'echo ini_get("memory_limit")."\n";'
1G
-
This reply was modified 9 years, 3 months ago by kmthompkins.
I’d suggest parsing the memory_limit to see if it contains M or G. If it’s G, then return the value multiplied by 1024.