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 ...
随机推荐
- PMP--1.3 项目环境
项目所处的环境可能对项目的开展产生有利或不利的影响.影响项目的环境因素==项目经理在项目期间需要考虑的因素.这些因素不需要死记硬背,需要有一定了解就可以,在项目开始前针对文中内容提前把环境了解清楚,并 ...
- Nginx-4.Nginx如何处理请求
原文 基于server_name 的虚拟站点 Nginx首先需要确定使用哪个server来处理请求.举个简单的例子,有下面几个server 第一个,监听80端口,为org站点 server { lis ...
- SpringBoot整合NoSql--(三)Redis集群
(1)集群原理 在Redis集群中,所有的Redis节点彼此互联,节点内部使用二进制协议优化传输速度和带宽. 当一个节点挂掉后,集群中超过半数的节点检测失效时才认为该节点已失效.不同于Tomcat集群 ...
- Openshift与Kubernetes的区别
Openshift与Kubernetes的区别 Openshift首个支持企业级 Java 的 PaaS 平台,支持 JEE6 与 JBoss 和其 Eclipse 集成开发环境以及 Maven 和 ...
- PL/SQL不安装Oracle连接,Oracle instantclient安装
================================ ©Copyright 蕃薯耀 2020-01-07 https://www.cnblogs.com/fanshuyao/ 第一步: 下 ...
- maven 新建站点
站点建立步骤启动eclipse_sts--->新建项目--->搜索maven -->选择maven-archetype-webapp 红色错误配置新建项目完成后--->inde ...
- 哈尔滨工业大学(深圳)本科毕业设计(论文)LaTeX模板:hitszthesis
目录 本篇文章的主要内容如下: 目录 引言 Why hitszthesis? 下载方式 编译方式简介 模板说明文档(用户手册) 毕业论文撰写样例 后记 引言 去年发布过哈深本科毕业设计(论文)的LaT ...
- HTML5文档类型如何定义,有哪些标签,以及如何使用,从整体认识HTML5
html5新增结构标签 header 头部 nav 导航 section 区域 article 文章 aside 侧边栏 figure 一组多媒体内容 figcaption 多媒体内容的标题 foot ...
- 令人抓狂的redis和rediscluster Python驱动包的安装
本文环境:centos 7,Python3编译安装成功,包括pip3,然后需要安装redis相关的Python3驱动包,本的redis指redis包而非redis数据库,rediscluster类似. ...
- 从接口自动化测试框架设计到开发(二)操作json文件、重构json工具类
用例模板里的请求数据多,看起来很乱,所以可以通过访问另外一个文件的方式获取请求数据 把请求数据都放在一个json文件中 取出login的内容: import json fp = open('G:/un ...