报错: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的更多相关文章

  1. (转载)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 ...

  2. Allowed memory size of 134217728 bytes exhausted

    错误信息: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65015808 bytes) 由于报错信息和数据库 ...

  3. Allowed memory size of 134217728 bytes exhausted解决办法(php内存耗尽报错)【简记】

    报错: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) i ...

  4. php的Allowed memory size of 134217728 bytes exhausted问题解决办法

    php的Allowed memory size of 134217728 bytes exhausted问题解决办法 报错: Fatal error: Allowed memory size of 1 ...

  5. 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 ...

  6. php的Allowed memory size of 134217728 bytes exhausted问题

    提示Allowed memory size of 134217728 bytes exhausted,出现这种错误的情况常见的有三种: 0:查询的数据量大. 1:数据量不大,但是php.ini配置的内 ...

  7. 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 ...

  8. 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 ...

  9. Allowed memory size of 134217728 bytes exhausted问题解决方法

    Allowed memory size of 134217728 bytes exhausted问题解决方法 php默认内存限制是128M,所以需要修改php.ini文件. 查找到memory_lim ...

  10. 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 ...

随机推荐

  1. ES6 - 基础学习(3): 变量的解构赋值

    解构赋值概述 1.解构赋值是对赋值运算符的扩展. 2.它是一种针对数组或者对象进行模式匹配,然后对其中的变量进行赋值. 3.代码书写上显得简洁且易读,语义更加清晰明了:而且还方便获取复杂对象中的数据字 ...

  2. 《手把手教你构建自己的 Linux 系统》学习笔记(6)

    目录 /dev 目录是干什么的? /proc 和 /sys 目录是干什么的? udev 这个软件是干什么用的? 目录映射是临时性的,还是永久性的? 命令行里大括号 "{}" 的作用 ...

  3. 版本管理git

    Git 是目前世界上最先进的分布式版本控制系统. git的主要操作步骤 git.init  初始化,显示成功后去相应的文件夹中查看是不是多了一个git文(版本库)  命令1.    git confi ...

  4. MySQL 8 InnoDB 集群生产部署

    生产部署InnoDB集群 1.先决条件 InnoDB集群使用组复制技术,所以InnoDB中的实例需要满足组复制要求.可以查看MySQL文档中组复制相关的部分,也可以通过AdminAPI提供的dba.c ...

  5. Git 尝试

    1,下载Git 2,安装GIt 3,config : git config --global user.name "mxb" git config --global user.em ...

  6. eclipse maven jdk1.8 还原站点项目红感叹号总是小结

    问题背景有三 maven 默认是jdk1.5jdk1.8 目录文件夹不全操作: 在项目上右击-> build path-->config build path-->libraries ...

  7. excel的count、countif、sunif、if

    一.count统计数值个数 格式:count(指定区域)  , 例如:count(B2:G5) 二.countif统计数值满足条件个数 格式:COUNTIF(条件区域,指定条件)  ,例如:count ...

  8. PHP MySQLi Prepared Statements Tutorial to Prevent SQL Injection

    https://websitebeaver.com/prepared-statements-in-php-mysqli-to-prevent-sql-injection#introduction On ...

  9. Redis入门-02-CentOS7环境搭建

    CentOS7下redis安装过程,安装后需要开启端口号6379 #下载 wget http://download.redis.io/releases/redis-3.2.4.tar.gz #解压 t ...

  10. HDU1070 - Milk

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1070 解题思路:主要考察C结构体排序. #include <bits/stdc++.h> ...