LaravelプロジェクトのTOP画面を表示させたい
質問失礼いたします。
EIPアドレスでlaravelプロジェクトのTOP画面を表示させたいのですが、HTTP500エラーになってしまいます。
だいぶハマっているので、ぜひお力添えいただければと・・・
###環境
- Mac
- AWS EC2
下記をEC2にインストール
- PHP 7.1.15
- Laravel 5.6.17
- Apache 2.4
- mysql
- git
###やったこと
- /etc/httpd/conf.d/vhosts.confに下記の記述(ドメイン名はまだ取得していないため、今後設定予定の仮の名前にしている)
<VirtualHost *:80> DocumentRoot "/var/www/html/laravelApp/public" ServerName www.laravelApp.jp:80 ServerAdmin hoge@hoge.com <Directory "/var/www/html/laravelApp/public"> AllowOverride All Options All Require all granted </Directory> </VirtualHost>
- /etc/hostsにサーバーネームの記述
138.111.111.111 www.laravelApp.jp:80
どこか記述が間違っているのか、苦戦しています。
パーミッションなどは、記事を参考に通しているはずだと思うのですが。。。
HTTP500のエラーが出ています。
apacheのエラーログを見ましたが、
PHP Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Debug\Exception\FatalErrorException::getStatusCode() in /var/www/html/matching/app/Exceptions/Handler.php:57\nStack trace:\n#0 /var/www/html/matching/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(112)~
と、長いログで全くわからず・・・・
足りない情報あればすぐに記載します、大変申し訳ありませんが、何卒宜しくお願い致します。
Laravel.logファイルのエラー内容
[2018-05-06 02:04:23] production.ERROR: Uncaught Error: Call to undefined method Symfony\Component\Debug\Exception\FatalThrowableError::getStatusCode() in /var/www/html/matching/app/Exceptions/Handler.php:57 Stack trace: #0 /var/www/html/matching/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(112): App\Exceptions\Handler->render(Object(Illuminate\Http\Request), Object(Symfony\Component\Debug\Exception\FatalThrowableError)) #1 /var/www/html/matching/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(89): Illuminate\Foundation\Bootstrap\HandleExceptions->renderHttpResponse(Object(Symfony\Component\Debug\Exception\FatalThrowableError)) #2 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\Debug\Exception\FatalThrowableError)) #3 {main} thrown {"exception":"[object] (Symfony\Component\Debug\Exception\FatalErrorException(code: 1): Uncaught Error: Call to undefined method Symfony\Component\Debug\Exception\FatalThrowableError::getStatusCode() in /var/www/html/matching/app/Exceptions/Handler.php:57 Stack trace: #0 /var/www/html/matching/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(112): App\Exceptions\Handler->render(Object(Illuminate\Http\Request), Object(Symfony\Component\Debug\Exception\FatalThrowableError)) #1 /var/www/html/matching/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(89): Illuminate\Foundation\Bootstrap\HandleExceptions->renderHttpResponse(Object(Symfony\Component\Debug\Exception\FatalThrowableError)) #2 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\Debug\Exception\FatalThrowableError)) #3 {main} thrown at /var/www/html/matching/app/Exceptions/Handler.php:57) [stacktrace] #0 {main}
Handler.php
1<?php 2 3namespace App\Exceptions; 4 5use Exception; 6use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; 7use Illuminate\Session\TokenMismatchException; 8use Illuminate\Validation\ValidationException; 9 10class Handler extends ExceptionHandler 11{ 12 /** 13 * A list of the exception types that are not reported. 14 * 15 * @var array 16 */ 17 protected $dontReport = [ 18 // 19 ]; 20 21 /** 22 * A list of the inputs that are never flashed for validation exceptions. 23 * 24 * @var array 25 */ 26 protected $dontFlash = [ 27 'password', 28 'password_confirmation', 29 ]; 30 31 /** 32 * Report or log an exception. 33 * 34 * @param \Exception $exception 35 * @return void 36 */ 37 public function report(Exception $exception) 38 { 39 parent::report($exception); 40 } 41 42 /** 43 * Render an exception into an HTTP response. 44 * 45 * @param \Illuminate\Http\Request $request 46 * @param \Exception $exception 47 * @return \Illuminate\Http\Response 48 */ 49 public function render($request, Exception $exception) 50 { 51 if ($exception instanceof TokenMismatchException) { 52 return redirect()->back()->with('message','セッションのタイムアウトとなりました。もう一>度入力してください。'); 53 } 54 if (get_class($exception) == "ErrorException" || $exception instanceof ValidationException) { 55 return parent::render($request, $exception); 56 } 57 $status = $exception->getStatusCode(); 58 return response()->view("errors.common", ['exception' => $exception], $status, $exception->getHeaders()); 59 } 60}
回答2件
あなたの回答
tips
プレビュー