I am trying to set memory_limit to 512M, but it's locekd to 256M.
ini_set('memory_limit','512M');
ini_get('memory_limit'); //> Returns: 256M
I have full control on my server. (it's a dedicated)
Please note that everything under 512M works.
ini_set('memory_limit','16M');
ini_get('memory_limit'); //> Returns: 16M
I found out why. in php.ini I had memory_limit = 256M
. Maybe this is considered as an upper limit
The PHP memory limit sets the maximum amount of memory any script on your website can use. But what exactly does that mean? Your website is powered by servers, which are just specialized computers used to keep the backend of a website running. Like normal computers, they use components like processors, storage, and RAM — also known as memory.
What Is Kinsta’s PHP Memory Limit? Users of all Kinsta plans enjoy a default PHP memory limit of 256 MB. This should be more than enough for 99% of all WordPress plugins and is in fact far more than most plugins should ever take.
Simply increase the default value (example: Maximum amount of memory a script may consume = 128MB) of the PHP memory limit line in php.ini. If you don’t have access to these files or lack the experience to make this change, you can contact your web host and ask them to increase your PHP memory limit.
The WordPress memory limit is also known as WordPress PHP memory limit or simply PHP memory limit. It mainly sets the maximum amount of memory that a script can use on the website. Servers store all the data and files of websites.
3 possibles I can think of / find:
Prior to PHP 5.2.1, in order to use this directive it had to be enabled at compile time by using --enable-memory-limit in the configure line.
OR
The issue detailed here: ini_set("memory_limit") in PHP 5.3.3 is not working at all
OR
ini_set is disabled
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With