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 =
这种方法需要重启服务器,很显然,此方法对虚拟机有限制。
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的内存限制 Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in
(转载)http://blog.csdn.net/beyondlpf/article/details/7794028 Fatal error: Allowed memory size of 13421 ...
- Allowed memory size of 134217728 bytes exhausted
错误信息: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65015808 bytes) 由于报错信息和数据库 ...
- Allowed memory size of 134217728 bytes exhausted解决办法(php内存耗尽报错)【简记】
报错: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) i ...
- php的Allowed memory size of 134217728 bytes exhausted问题解决办法
php的Allowed memory size of 134217728 bytes exhausted问题解决办法 报错: Fatal error: Allowed memory size of 1 ...
- PHP的内存限制 Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in Fa ...
- php的Allowed memory size of 134217728 bytes exhausted问题
提示Allowed memory size of 134217728 bytes exhausted,出现这种错误的情况常见的有三种: 0:查询的数据量大. 1:数据量不大,但是php.ini配置的内 ...
- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2611816 bytes)
一段PHP程序执行报错: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261181 ...
- Allowed memory size of 134217728 bytes exhausted (tried to allocate 2 bytes)
出现 Allowed memory size of 134217728 bytes exhausted (tried to allocate 2 bytes)时在php.ini文件中配置 memor ...
- Allowed memory size of 134217728 bytes exhausted问题解决方法
Allowed memory size of 134217728 bytes exhausted问题解决方法 php默认内存限制是128M,所以需要修改php.ini文件. 查找到memory_lim ...
- PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted 错误
php运行一段时间后,部分页面打不开,查看nginx日志里面一直在报PHP message: PHP Fatal error: Allowed memory size of 134217728 by ...
随机推荐
- rpm | 升级软件包
rpm | 升级软件包 检查已安装包 rpm -qa | grep samba samba-common-3.6.9-164.el6.x86_64 samba-3.6.9-164.el6.x86_64 ...
- Python和Anoconda和Pycharm联合使用教程
简介 Python是一种跨平台的计算机程序设计语言.是一种面向对象的动态类型语言,最初被设计用于编写自动化脚本(shell),随着版本的不断更新和语言新功能的添加,越多被用于独立的.大型项目的开发. ...
- Luarocks 安装艰难过程
https://www.cnblogs.com/fanxiaojuan/p/11551268.html
- 剑指offer-面试题58_2-左旋转字符串-字符串
/* 题目: 将字符串的前sep个字符转移到字符串尾部. */ /* 思路: 更好的方法: 先翻转前sep个字符,再翻转后面的字符,最后全体翻转. */ #include<iostream> ...
- Python 实现选择排序
选择排序算法步骤: 找到数组中最小的那个元素中, 将它和数组的第一个元素交换位置, 在剩下的元素中找到最小的元素,将它和数组的第二个元素交换位置, 如此往复,知道将整个数组排序. 逐步分析: 假设一个 ...
- mybatis_day01
Mybatis01 1.什么是mybatis 1.1mybatis 一个基于Java的持久层框架 1.2持久层 操作数据库那层代码 项目分层: 界面层(jps/controller) 业务层(serv ...
- JS DOM创建节点
DOM节点操作之增删改查 document.write() 可以向文档中添加节点 但是有个致命问题,会把文档原有的节点全部清空 因此不推荐使用 <!DOCTYPE html> <ht ...
- nginx 反向代理及 https 证书配置
nginx 反向代理及 https 证书配置 author: yunqimg(ccxtcxx0) 1. 编译安装nginx 从官网下载 nginx源码, 并编译安装. ./configure --pr ...
- maven的核心概念——坐标
7.1 几何中的坐标 [1]在一个平面中使用x.y两个向量可以唯一的确定平面中的一个点. [2]在空间中使用x.y.z三个向量可以唯一的确定空间中的一个点. 7.2 Maven的坐标 使用如下三个向量 ...
- [Python]PyCharm中%matplotlib inline报错
%matplotlib作用 是在使用jupyter notebook 或者 jupyter qtconsole的时候,才会经常用到%matplotlib,也就是说那一份代码可能就是别人使用jupyte ...