在同一个系统中,我可以调用db,这没有问题,但在某些情况下(使用最大的表),我会

"PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32 bytes) in /home/forge/sximo.sp-marketing.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 311

I debugged the code and the problem is a basic query:

"  SELECT partidascapturainfo.* FROM partidascapturainfo    WHERE partidascapturainfo.partidascapturainfoid IS NOT NULL       ORDER BY partidascapturainfoid asc   LIMIT  0 , 10 "

当我在MySQL客户端中运行查询时,查询运行时间为0.17s

I've already set memory_limit to 2048, restart nginx and my query only return 10 rows...

Here are my 10 rows:

123044,42016,249,3762,2,,0
123045,42016,249,3761,2,,0
123046,42016,249,3764,1,,0
123047,42016,249,3765,,,0
123048,42016,249,3775,,,0
123049,42016,249,3771,3,,0
123050,42016,249,3772,3,,0
123051,42016,250,3844,HAY,,0
123052,42016,255,3852,,,0
123053,42017,249,3761,1,,0

Any Idea what's going on???

推荐答案

您可以try 编辑/etc/php5/fpm/php.伊尼:

; Old Limit
; memory_limit = 512M

; New Limit
memory_limit = 2048M

You may need to restart nginx:

sudo systemctl restart nginx

You may also have an infinite loop somewhere. Can you post the code you're calling?

Laravel相关问答推荐

警告:构建Reaction App(VITE)后无法解码下载的字体警告

laravel错误更新使用外键的数据库

如何使用动态翻译键翻译 Laravel硬编码字符串(还有 1 个错误)..(验证异常类)

使用 Laravel 计算页面浏览量

验证错误后的 Laravel 自定义重定向

Eloquent的条件过滤器

使用 Laravel 限制多态多对多关系中的相关记录

Laravel 5.3 auth 判断构造函数返回 false

如何使用 Eloquent Laravel 更新集合

为什么人们将 .env 放入 gitignore?

CRON 作业(job) - LARAVEL - 输出

在 Laravel 4 迁移中创建 MYSQL 过程

Laravel Eloquent 在子查询中有两个WHERE NOT IN

我如何从给定的日期时间 struct 创建Carbon 对象?

Laravel 获取查询字符串

如何在 vs 代码中自动导入 laravel 类

laravel如何访问具有表编号名称的列?

将值插入隐藏输入 Laravel Blade

如何在 Laravel 5 中验证 RESTful API?

laravel:如何获取 eloquent 模型的列名?