php Allowed memory size of 134217728 bytes exhausted
报错:PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in
解析:134217728/1024/1024 = 128
解释:内存已耗尽,这关系到PHP的memory_limit的设置问题,根据自己的需要及参考本机的内存大小修改php内存限制。
这里有三种解决方案 :
1、修改php.ini (改配置)
memory_limit = 128
这种方法需要重启服务器,很显然,此方法对虚拟机有限制。
2、通过ini_set函数修改配置选项值 (改代码)
ini_set ("memory_limit", "128M") ;
3、直接取消PHP的内存限制(改代码)
ini_set ("memory_limit","-1");
如果通过上面的方式修改后还会报这个错误,那你要检查一下你写的代码是否存在效率问题。(举例:从数据库查询到的数据加载到内存里面,然后php 进行数据处理,如果代码写的不是很严谨存在效率问题,特别是数据量非常大的时候也会导致内存耗尽)
PHP中,对于memory_limit配置中的定义解释是: memory_limit = 128M ; Maximum amount of memory a script may consume (128MB) 最大单线程的独立内存使用量。也就是一个web请求,给予线程最大的内存使用量的定义。
php Allowed memory size of 134217728 bytes exhausted相关推荐
- php.ini 老薛,出现Allowed memory size of 134217728 bytes exhausted怎么办?
有站长在交流群内说到使用 ZBlogPHP 建站在发布文章的时候总是出现以下错误: Allowed memory size of 134217728 bytes exhausted(tried to ...
- php遇到Allowed memory size of 134217728 bytes exhausted问题解决方法
终端报出了Allowed memory size of 134217728 bytes exhausted错误,而且重启电脑再次执行仍然是一样.上网查了查,是因为php默认内存限制是128M,所以需要 ...
- 执行php程序的时候,报错Allowed memory size of 134217728 bytes exhausted (tried to allocate 83 bytes)...
执行php程序时,会报下面的错误 Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 83 ...
- php的Allowed memory size of 134217728 bytes exhausted问题解决办法
php的Allowed memory size of 134217728 bytes exhausted问题解决办法 参考文章: (1)php的Allowed memory size of 13421 ...
- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 85 bytes)
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 85 bytes) PHP5中,对于m ...
- PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes)
内存已耗尽,这关系到PHP的memory_limit的设置问题 1.修改配置文件 ~]# vi /etc/php7/php.ini memory_limit = 256M 2.重启 superviso ...
- Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 64 bytes) in D
Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 64 bytes) in D 从数据库 ...
- Php Fatal error: Allowed memory size of 33554432 bytes exhausted 的解决办法
Php Fatal error: Allowed memory size of 33554432 bytes exhausted 的解决办法 在 php.ini 配置文档里面,默认的memory_li ...
- Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 359404 bytes) in
为什么80%的码农都做不了架构师?>>> Fatal error: Allowed memory size of 8388608 bytes exhausted (tried ...
- composer windows 下面内存溢出 Allowed memory size of 1610612736 bytes exhausted
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocat e 4096 bytes) in ph ...
最新文章
- 跳来跳去,到底去大公司还是小公司?
- 番茄工作法:番茄时间管理方法与番茄工作法软件图解提高工作效率
- mysql 5.5.安装包_Mysql的详细安装教程!亲测可用!!!
- 【Codeforces 922D】Robot Vacuum Cleaner
- 在 SharePoint 2013 中选择正确的 API 集
- Asterisk 并发量到100后就出现拨打电话挂机问题
- 用 @Value(“${xxxx}“)注解从配置文件读取值的用法
- LeetCode 423. 从英文中重建数字(找规律)
- 4.1 卷积神经网络调参-adagrad_adam
- 原创精华:剖析亿级请求下的多级缓存
- Django Bootstrap开发笔记01 - 添加简单网页
- fetch 函数分装
- bzoj 1133: [POI2009]Kon(DP)
- 教你如何与电脑病毒打游击
- CentOS重启与关机
- shopex admincore.php,shopex网店系统更换空间后出错:Fatal error: Incompatible file format:...
- 怎么学计算机玩游戏,如何才能录制手机玩游戏的视频-电脑自学网
- 拿来主义vs.自主创新
- python之使用cmd命令行写程序
- 前端工程师考核总结_最新前端工程师周工作总结
热门文章
- -TEST 12 for NOIP ......(30-300)-----(( ! ))
- 怎么设置ppt页面的长度和宽度_ppt幻灯片的尺寸大小要设置成多少厘米的,但是我的页面设置的大小单位是英寸,怎么设置...
- 中山大学3D游戏设计读书笔记 unity3D Note9
- pytorch加载数据时中途卡死且未报错
- C++ builder 添加资源文件
- 接触式光电位移传感器的原理是
- python 100天 github_GitHub - theroad/Python-100-Days: Python - 100天从新手到大师
- 我不是蓝牙大神,但还是斗胆对蓝牙学习路线给点建议!
- android 修改软件图标大小,android – 是否可以在EditText中更改图标的大小
- Retrofit 使用 DELETE 方式