Thinkphp5错误:Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 68 bytes)

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 68 bytes)

1 $users = Db::name(‘users’)->select();
2 dump($users);

对于大数据量查询结果,其内容超出了memory size,修改代码如下:

1 $users = Db::name(‘users’)->limit(10)->select();

完美解决!!!

时间: 2024-08-25 03:44:11

Thinkphp5错误:Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 68 bytes)的相关文章

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in

解释是可用内存已耗尽,这关系到PHP的memory_limit的设置问题. 我在网上看到,有两种方法解决 1.修改php.ini memory_limit = 128 这种方法需要重启服务器,很显然,此方法对虚拟机有限制. 2.通过ini_set函数修改配置选项值 ini_set ('memory_limit', '128M') 但是我用完两种方法后都没有成功. 虽然看了一些资料上面说PHP5中,对于memory_limit的设定为128M的上限,但是我还是尝试了一下去分配更多的内存,将memo

Fatal error: Allowed memory size of 8388608 bytes exhausted

这两天安装bugfree,更换了一个数据量较大的库,结果打开bug详情页要么是空白页,要么就报如题的错误,错误信息还包括C:\wamp\www\bugfree\Include\Class\ADOLite\adodbSQL_drivers\mysql\mysql_driver.inc 506,打开这个mysql_driver.inc也看不出来什么,倒是按照如题的文字可以百度出一些解决方案,一般是如下的内容: php错误提示 Fatal error: Allowed memory size of 8

执行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 bytes) in /mnt/Change/www/html/data/conn.php on line 18 第一种方法:不推荐 修改php配置文件php.ini,将memory_limit的值改大,但是不建议这么做,因为无论修改的再大,有可能还是会报这个错误,因为不知道运行这个php代码到底需

Allowed memory size of 134217728 bytes exhausted

错误信息:1,浏览器报500页面,2,nginx日志报错信息如下:[error] 11243#0: *11550 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 57257775 bytes) 解决方法:因为php默认内存限制是128M,所以需要修改php.ini文件.找到memory_limit =

php的Allowed memory size of 134217728 bytes exhausted问题

提示Allowed memory size of 134217728 bytes exhausted,出现这种错误的情况常见的有三种: 0:查询的数据量大. 1:数据量不大,但是php.ini配置的内存太小. 2:逻辑出现死循环. 解析: 134217728/1024/1024 = 128M 解决方案: 0:修改php.ini memory_limit = 128 但是这种需要重启服务器,所以对于虚拟机有限制 1:通过ini_set函数修改配置选项值 // 升级256M.128M内存 ini_s

php遇到Allowed memory size of 134217728 bytes exhausted问题解决方法

终端报出了Allowed memory size of 134217728 bytes exhausted错误,而且重启电脑再次执行仍然是一样.上网查了查,是因为php默认内存限制是128M,所以需要修改php.ini文件. 查找到memory_limit = 128M这一行,将128M改大点,我这里直接是改成了2048M. 2.重启服务器,通过sudo /usr/sbin/apachectl restart来重启apache服务器,当然其实用终端执行php的话,不重启服务器也是可以的. 3.重

PHP内存溢出Allowed memory size of 解决办法

PHP内存溢出Allowed memory size of 解决办法 博客分类: php ============================Allowed memory size of  xxx bytes 以前追踪过这个问题,但是那个时候工具用的不太好,没看的这么细,这次搞的比较细,修正了偶以前的看法 .于是写小文一篇总结一下. PHP偶尔会爆一下如下 错误Allowed memory size of  xxx bytes exhausted at xxx:xxx (tried to a

PHP内存溢出 Allowed memory size of 解决办法

PHP出现如下错误:Allowed memory size of  xxx bytes exhausted at xxx:xxx (tried to allocate xxx bytes)    关于这一点,本站点中,http://nodonkey.iteye.com/blog/728223 有所讲述.        同时,还有 http://hi.baidu.com/thinkinginlamp/blog/item/e400f819a3caab7cdbb4bd4e.html 此文也是讲这个问题

mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

安装mysql-python之前, 请先安装setuptools. https://pypi.python.org/pypi/setuptools/7.0 下载mysql-python. 下载源码包. https://pypi.python.org/pypi/MySQL-python/1.2.5 解压后执行 python setup.py install 提示错误: fatal error C1083: Cannot open include file: 'config-win.h': No s