解决php服务器软件内存耗尽Allowed memory size of 123456789 bytes exhausted方法
2011-06-01 11:27
686 查看
出现该错误的原因:
是因为php页面消耗的最大内存默认是为 8M (在PHP的ini件里可以看到) ,如果文件太大 或图片太大 在读取的时候 会发生上述错误。
解决办法有三个:
1,修改 php.ini (永久性方法,只要用这个服务器软件)
将memory_limit由 8M 改成 16M(或更大),重启apache服务
2,在PHP 文件中 加入 ini_set(”memory_limit”,”100M”); (暂时性方法,只作用于这个php文件所涉及的范围)
注意:为了系统的其它资源的正常使用 请您不要将 memory_limit设置太大,其中-1为不限
3,修改.htaccess 文档(前提是该目录支持.htaccess) (暂时性方法,只作用于此目录及其所有子目录)
在文档中新增一句:php_value memory_limit 16M(或更大)
是因为php页面消耗的最大内存默认是为 8M (在PHP的ini件里可以看到) ,如果文件太大 或图片太大 在读取的时候 会发生上述错误。
解决办法有三个:
1,修改 php.ini (永久性方法,只要用这个服务器软件)
将memory_limit由 8M 改成 16M(或更大),重启apache服务
2,在PHP 文件中 加入 ini_set(”memory_limit”,”100M”); (暂时性方法,只作用于这个php文件所涉及的范围)
注意:为了系统的其它资源的正常使用 请您不要将 memory_limit设置太大,其中-1为不限
3,修改.htaccess 文档(前提是该目录支持.htaccess) (暂时性方法,只作用于此目录及其所有子目录)
在文档中新增一句:php_value memory_limit 16M(或更大)
相关文章推荐
- 修改 PHP 消耗内存的方法(Allowed memory size of 8388608 bytes exhausted解决方法)
- 修改 PHP 消耗内存的方法(Allowed memory size of 8388608 bytes exhausted解决方法)
- PHP Fatal error: Allowed memory size of 134217728 bytes exhausted……解决方法
- php遇到Allowed memory size of 134217728 bytes exhausted问题解决方法
- Mac下执行php遇到Allowed memory size of 134217728 bytes exhausted问题解决方法
- php内存溢出,出现Allowed memory size of 8388608 bytes exhausted错误的解决办法
- PHP的内存限制 Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in
- php内存不够用,出现Allowed memory size of 8388608 bytes exhausted (tried to allocate 1298358 bytes)
- Fatal error: Allowed memory size of 8388608 bytes exhausted解决方法
- 解决PHP之 Allowed memory size of xxx bytes exhausted
- Fatal error: Allowed memory size of 8388608 bytes exhausted解决方法
- 解决PHP之 Allowed memory size of xxx bytes exhausted
- Php Fatal error: Allowed memory size of xxx bytes exhausted 的解决办法
- PHP错误Allowed memory size of 67108864 bytes exhausted的3种解决办法
- Php Fatal error: Allowed memory size of 33554432 bytes exhausted 的解决办法
- PHP的内存限制 Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in
- discuz Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 262144 bytes) 错误解决方法
- PHP的内存限制 Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in
- PHP脚本占用内存太多,Fatal Error: Allowed memory size of xxxxxx bytes exhausted
- (转载)PHP的内存限制 Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in