PHP错误Allowed memory size of 67108864 bytes exhausted的3种解决办法
2014-07-28 10:16
941 查看
今天在百度知道看php相关资料时发现一个网友问一个wordpress安装提示错误的一个问题,说他在安装wordpress安装包时遇到这样一个问题:Fatal error:Allowed memory size of 67108864 bytes exhausted (tried to allocate 76 bytes) in…..这个问题小编以前没遇到过,根据提示肯定是内存溢出造成的。至于为什么会出现这样的提示呢?下面我把自己整理的出错原因和解决办法给phper分享一下,希望有所帮助。
出错原因:
因为php页面消耗的最大内存默认是为8M (在PHP的php.ini配置文件里可以看到) ,如果文件太大或图片太大,在读取的时候会发生上述提示错误。
解决办法,个人目前知道的有三种解决方案:
第一中解决方案是:在PHP文件中加入ini_set(”memory_limit”,”80M”);当然80M可以根据自己的情况改动,也不要太大哦,否则系统其它资源会遇到问题哦,其中-1为不设限。
第二中解决方案是:修改 php.ini配置文件,在php.ini中找到
; http://php.net/memory-limit
memory_limit = 16M,将前面的分号去掉,改动值的大小,将memory_limit由8M改成16M(或更大),重启apache服务即可。
第三种解决方案是:修改.htaccess分布式配置文件(注意哦:前提是该目录支持.htaccess)。在文档中新增一句:php_value memory_limit 16M(或更大)
您可能感兴趣的文章:
相关文章推荐
- PHP错误Allowed memory size of 67108864 bytes exhausted的3种解决办法
- php内存溢出,出现Allowed memory size of 8388608 bytes exhausted错误的解决办法
- php内存溢出,出现Allowed memory size of 8388608 bytes exhausted错误的解决办法
- PHP提示Fatal error: Allowed memory size of 8388608 bytes exhausted的解决办法
- Php Fatal error: Allowed memory size of 33554432 bytes exhausted 的解决办法
- Php Fatal error: Allowed memory size of 33554432 bytes exhausted 的解决办法
- Php Fatal error: Allowed memory size of xxx bytes exhausted 的解决办法
- Php Fatal error: Allowed memory size of 33554432 bytes exhausted 的解决办法
- 修改 PHP 消耗内存的方法(Allowed memory size of 8388608 bytes exhausted解决方法)
- zencart Fatal error: Allowed memory size of 33554432 bytes exhausted的解决办法
- PHP Fatal error: Allowed memory size of 134217728 bytes exhausted……解决方法
- 解决PHP之 Allowed memory size of xxx bytes exhausted
- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2611816 bytes)错误的解决
- 解决php服务器软件内存耗尽Allowed memory size of 123456789 bytes exhausted方法
- 修改 PHP 消耗内存的方法(Allowed memory size of 8388608 bytes exhausted解决方法)
- PHP错误:Allowed memory size of 134217728 bytes exhausted
- discuz Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 262144 bytes) 错误解决方法
- Mac下执行php遇到Allowed memory size of 134217728 bytes exhausted问题解决方法
- php遇到Allowed memory size of 134217728 bytes exhausted问题解决方法
- PHP错误——Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes)