尝试在php中“包含”视图时出现502错误

I am currently trying to 'include' two views onto my homepage view. One creates the comment and that works. The second is to show the comments and that code is what throws the 502 error.

Here is the controller:

 /**
 * Display a listing of the resource.
 * GET /comments
 *
 * @return Response
 */
public function create()
{
    return View::make('comments.create');
}

public function display($comment)
{
    $comment_id = $this->commentRepository->find($comment);
    return View::make('comments.show')->with('comment', $comment_id);
}

Here is the dashboard view:

@extends('layouts.master')
@section('content')
<h1>Dashboard</h1>
@include('comments.create')
@include('comments.show')
@stop

Here is the 'show' view:

@foreach
<p>{{ $comment }}</p>
@endforeach

I suggest you check your webserver/php-fpm logs for PHP error (/var/log/...) output if code seems to be correct.