質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Laravel 5

Laravel 5は、PHPフレームワークLaravelの最新バージョンで、2014年11月に発表予定です。ディレクトリ構造がが現行版より大幅に変更されるほか、メソッドインジェクションやFormRequestの利用が可能になります。

Q&A

3回答

1663閲覧

routingの仕組みがわからないどころか、500エラーで頭真っ白

harpy

総合スコア42

Laravel 5

Laravel 5は、PHPフレームワークLaravelの最新バージョンで、2014年11月に発表予定です。ディレクトリ構造がが現行版より大幅に変更されるほか、メソッドインジェクションやFormRequestの利用が可能になります。

0グッド

0クリップ

投稿2017/11/20 14:07

編集2022/01/12 10:55

laravelでプロジェクトを作って、ハローワールドをしようとしているところです。

プロジェクトフォルダの中のroutesのなかのweb.phpの中に追記して、routingの仕組みを学ぼう!ってところなんですが、500エラーがでて、どうやって解決したらいいのかわかりません。
一応、追記部分を下に載せておきます。
アドバイスお願いいたします。

ファイルは以下に置いています。
C:\xampp\htdocs\laravelapp\routes\web.php

XAMPPのv3.2.2です
phpは7.1.11です
laravelはLaravel Framework 5.5.21です

追記:XAMPPをつかわないで、

php artisan serve

を使って動かしたら、動きました。
ソースの問題というより、設定の問題みたいです。
どうやったら、XAMPPのほうで動かせるようになるんでしょうか。何を確認したほうがいいかほかにありましたら、ご教授ください。

$html = <<<EOF <html> <head> <title>Hello</title> <style> body {font-size:16pt; color:#999;} h1 { font-size:100pt; text-align:right; color:#eee; margin:40px 0px -50px 0px;} </style> </head> <body> <h1>Hello</h1> <p>This is sample page.</p> <p>これはサンプルページです。</p> </body> </html> EOF; Route::get('hello', function () use ($html) { return $html; });
n Nov 20 22:02:37.193657 2017] [core:error] [pid 16616:tid 1928] [client ::1:52592] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:02:37.193657 2017] [core:error] [pid 16616:tid 1928] [client ::1:52592] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:02:56.160334 2017] [core:error] [pid 16616:tid 1928] [client ::1:52595] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:02:56.160334 2017] [core:error] [pid 16616:tid 1928] [client ::1:52595] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:05:36.895584 2017] [core:error] [pid 16616:tid 1936] [client ::1:52608] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:05:36.895584 2017] [core:error] [pid 16616:tid 1936] [client ::1:52608] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:06:04.273001 2017] [core:error] [pid 16616:tid 1928] [client ::1:52610] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:06:04.273001 2017] [core:error] [pid 16616:tid 1928] [client ::1:52610] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:56:32.104683 2017] [core:error] [pid 16616:tid 1936] [client ::1:52803] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:56:32.104683 2017] [core:error] [pid 16616:tid 1936] [client ::1:52803] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:56:51.642341 2017] [ssl:warn] [pid 5792:tid 560] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Mon Nov 20 22:56:51.678279 2017] [core:warn] [pid 5792:tid 560] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Mon Nov 20 22:56:51.747466 2017] [ssl:warn] [pid 5792:tid 560] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Mon Nov 20 22:56:51.768522 2017] [mpm_winnt:notice] [pid 5792:tid 560] AH00455: Apache/2.4.29 (Win32) OpenSSL/1.0.2l PHP/7.1.11 configured -- resuming normal operations [Mon Nov 20 22:56:51.768522 2017] [mpm_winnt:notice] [pid 5792:tid 560] AH00456: Apache Lounge VC14 Server built: Oct 22 2017 11:52:30 [Mon Nov 20 22:56:51.768522 2017] [core:notice] [pid 5792:tid 560] AH00094: Command line: 'c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache' [Mon Nov 20 22:56:51.770527 2017] [mpm_winnt:notice] [pid 5792:tid 560] AH00418: Parent: Created child process 2956 [Mon Nov 20 22:56:52.236293 2017] [ssl:warn] [pid 2956:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Mon Nov 20 22:56:52.339533 2017] [ssl:warn] [pid 2956:tid 580] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Mon Nov 20 22:56:52.362407 2017] [mpm_winnt:notice] [pid 2956:tid 580] AH00354: Child: Starting 150 worker threads. [Mon Nov 20 22:57:14.859532 2017] [core:error] [pid 2956:tid 1932] [client ::1:52829] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Mon Nov 20 22:57:14.859532 2017] [core:error] [pid 2956:tid 1932] [client ::1:52829] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

m.ts10806

2017/11/21 00:26 編集

提示のソースはどこの何を提示されているのでしょうか。ファイルが違うのであれば、ファイル名やフォルダ構成・階層なども明記してください。また、プログラムコードはコードブロック(```)で囲ってください。
harpy

2017/11/21 11:04

提示のソースはC:\xampp\htdocs\laravelapp\routes\web.phpのものです
harpy

2017/11/21 11:17

正しい質問の仕方もわからないのでご指摘いただきありがとうございます。
guest

回答3

0

提示頂いたコードをroutes/web.phpに貼り付けてみましたが正常に出力されますね。
上記のコードの問題ではない様です。

ちなみにアクセスしているURLは正しいでしょうか?ローカルホストであれば
http://localhost/ディレクトリ名/public/helloとなりますが…

後は、ディレクトリのパーミッションの確認をしてみると良いかもしれません。
こちらのサイトの様なケースがあるようです。

投稿2017/11/21 00:57

motuo

総合スコア3027

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

500エラーの場合は、内部エラーとしてLaravelアプリのstorage/logsにあるログにエラー内容が出力されているので確認してみてください。
Laravelのlogが出力されない時は、その前段階のエラーとしてApacheやNginx等のWebサーバーのログを確認してみてください
Laravel 5.5 エラーとログ

投稿2017/11/20 15:11

aro10

総合スコア4106

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

公式サイトの記事もありますが、それで分かりづらければQiitaなどのまとめ記事を読むと良いです。

PHPやlaravelのバージョンもご提示いただければもっと適切な回答がつくとは思いますが・・・。

投稿2017/11/21 00:32

m.ts10806

総合スコア80765

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問