Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 43 bytes) in F:\APM

来源:百度知道 编辑:UC知道 时间:2024/07/07 23:21:48
我用的是织梦的CMS系统,我修改了首页模版,修改之后更新网站 马上就出现了这个问题了。
Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 43 bytes) in F:\APMServ-v5.2.6\APMServ5.2.6\www\htdocs\include\dedetag.class.php on line 186

解决方法:
1、找到你服务器(租用的虚拟主机需管理员才有修改权限)里的php.ini文件(我用的是APMServ Apache服务器,php.ini就在PHP目录下面),用记事本打开。
2、搜索“Resource Limits ;”找到相关配置,修改“memory_limit”的值,默认是20M,具体要修改为多少由你自己视情况而决定,由于我说遇到的的错误提示我“tried to allocate 780053 bytes”,所以我把memory_limit的值设为128M,如下:
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
memory_limit =128M
3、保存php.ini文件后并重启Apache即可解决问题。