Hi there,
For us it’s working correctly on the websites with 1GB of memory or more.
How would you change it so that it also works for you?
Best regards from Spain.
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.
Hi there,
We use ini_get('memory_limit') to get the memory limit which on all the servers we have used for testing returns the value in MB and not in GB.
For example: Memory: 40.9 of 1028 MB (4%)
That’s why we have never had your problem.
In order to change the coding we would like to reproduce the problem. What OS and PHP version are you running?
Best regards from Spain.
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.
Hi there,
On our CentOS 6.8, CentOS 7 and Ubuntu 14.04 with PHP 7.0.x we get the memory limit always in MB and not in GB.
We are no system administrators and therefore will have to search for somebody to reproduce this case and solve it.
This will take some time.
Best regards.