admin管理员组文章数量:1122846
Unusually, I would like to reduce the wordpress / woocommerce memory limit, as it leads to too high memory consumption on the server.
I'm not able to change my php memory-limit variable due to my Hosting Service (Siteground).
Nevertheless, it should be possible to set the memory limit for Wordpress.
I have already tried this via the wp-config file.
While Wordpress internally shows me the value I defined for the variables under Site Health, WP still doesn't seem to use these values.
Furthermore, under Woocommerce -> Status I am still shown a different value for the memory limit (the value of the PHP variables, not the WP variables).
Also an error message regarding critical allowed memory size also indicates that the value of the wp-config file does not apply.
Unusually, I would like to reduce the wordpress / woocommerce memory limit, as it leads to too high memory consumption on the server.
I'm not able to change my php memory-limit variable due to my Hosting Service (Siteground).
Nevertheless, it should be possible to set the memory limit for Wordpress.
I have already tried this via the wp-config file.
While Wordpress internally shows me the value I defined for the variables under Site Health, WP still doesn't seem to use these values.
Furthermore, under Woocommerce -> Status I am still shown a different value for the memory limit (the value of the PHP variables, not the WP variables).
Also an error message regarding critical allowed memory size also indicates that the value of the wp-config file does not apply.
1 Answer
Reset to default 0So you've tried setting the WP_MEMORY_LIMIT
variable in the wp-config.php
file, but have you tried .user.ini
or .php.ini
?
Create one of those files (yes, with the period in front) and then use:
memory_limit=30M
Or whatever value you're looking for. By default, WordPress is set to 40mb for a single installation, and 64mb for a multisite installation.
But as Tom mentioned in the comments, the solution to your problem might not be this. This may lead to server timeouts instead.
本文标签: phpChanging WPMEMORYLIMIT doesn39t affect actual memory limit
版权声明:本文标题:php - Changing WP_MEMORY_LIMIT doesn't affect actual memory limit 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736285409a1927455.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
var_dump(ini_get_all()['memory_limit']);
from inside WordPress somewhere: if the dumped out access value is 4 then no you can't change it. – Rup Commented Sep 8, 2022 at 12:37