2023-05-12 开启多语言插件支持……

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate xxx bytes)

php 苏 demo 2286℃ 0评论

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate xxx bytes)

它是说,你正在进行的操作需要这么多的内存,但你现在服务器分配的内存不足。
正常情况下,服务器的内存当然是够的,只是你的配置文件需要修改。
解决这个问题,我们一般有两种方式:

1、修改WP配置文件。

这是最简单的方式,编辑wp-config.php这个文件,给他加上一句:
define(‘WP_MEMORY_LIMIT’, ’64M’);
其中64M可以写得更大,比如96M。

2、修改php.ini
到你的网站根目录下,建立一个php.ini文件,写入下面这句:
memory_limit = 64MB
然后再到网站根目录下修改.htaccess这个文件,写入下面这句:
SetEnv PHPRC /home/host1/public_html/usr1/
(unix path to the directory where php.ini is)
(keep the slashes)

一般情况下,使用第一种方法即可。

打赏

转载请注明:苏demo的别样人生 » Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate xxx bytes)

   如果本篇文章对您有帮助,欢迎向博主进行赞助,赞助时请写上您的用户名。
支付宝直接捐助帐号oracle_lee@qq.com 感谢支持!
喜欢 (0)or分享 (0)