允许的内存大小为268435456字节已用尽 [英] Allowed memory size of 268435456 bytes exhausted
问题描述
可能重复:
允许的X字节已用尽的内存大小
Possible Duplicate:
Allowed memory size of X bytes exhausted
我正在处理一个相当大的数据库(87mb)导入,为此,我使用了一个php脚本. 所有操作均在Ubuntu Lucid上通过apache安装在区域设置中进行.
I'm handling with a quite little big database (87mb) import and to do that I use a php script. All the operations are made in locale with an apache installation on Ubuntu Lucid.
几分钟后运行脚本时,出现此错误:
When I run the script after few minutes I receive this error:
Allowed memory size of 268435456 bytes exhausted
我已将php.ini文件中的memory_limit
更改为2GB,并重新启动了Apache.之后,我检查了phpinfo()
,发现memory_limit
设置为'2048M',所以一切正常.
I've changed memory_limit
to 2GB in php.ini file and restarted apache. After that I've checked phpinfo()
and I see that memory_limit
is set to '2048M' so all is ok.
但是当我重新启动脚本时,我收到了同样的错误,256mb的内存限制被夸大了.
But when i relaunch my script i receive the same error, 256mb memory limit exahusted.
我在哪里错了?
推荐答案
如果您使用的脚本是从其他人那里借来的,请确保没有任何ini_set('memory_limit', '256M')
可以产生与所看到的完全一样的效果,尽管进行了任何更改您是在php.ini中制作的.
If the script you are using is borrowed from someone else make sure there is no ini_set('memory_limit', '256M')
which would produce the exactly effect you are seeing in spite of any change you made in php.ini.
这篇关于允许的内存大小为268435456字节已用尽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!