【发布时间】:2016-08-26 23:22:33
【问题描述】:
在一个查询生成器中执行select 和with 时,不会出现服务器错误。我刚刚收到以下消息:<domain> page isnt working. <domain> didn't send any data.
当我签入 /var/log/apache2/error.log 有一个日志:
child pid 1948 exit signal Segmentation fault (11), possible coredump in /etc/apache2
我尝试过使用here 提到的查询范围eg
$posts = Post::with(['image' => function($query){
$query->select('id');
}])->select('id')->get();
如果我将get() 更改为toSql(),它只会输出select id from posts;
我还尝试删除 select 并将列传递给 get(),但没有成功。
进一步调查:
我尝试设置 GDP 来调试 apache 核心转储,但似乎没有创建任何转储。
我已经设置了 xdebug 并跟随函数堆栈到它的 death here at function loadRelation() 在 Eloquent\Builder.php 内。
在此之前,它调用 eagerLoadRelations(array $models) 并正确获取所有 Post 模型作为仅具有 id 属性的帖子集合,但在加载图像关系的第一次迭代时它就死了
call_user_func($constraints, $relation);
任何帮助或建议将不胜感激。
【问题讨论】:
标签: php apache laravel eloquent lumen