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

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

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

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

Q&A

解決済

1回答

3014閲覧

Apache 500エラー PHP8 laravel8

navca

総合スコア44

Laravel

LaravelとはTaylor Otwellによって開発された、オープンソースなPHPフレームワークです。Laravelはシンプルで表現的なシンタックスを持ち合わせており、ウェブアプリケーション開発の手助けをしてくれます。

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

0グッド

0クリップ

投稿2021/01/28 15:03

編集2021/01/29 08:30

Laravelでアプリを作成しています。192.168.33.10のルートにアクセスすると画面は表示されるのですが、error_logに以下のエラーが出力されます。表示されたHTMLからform.submit()を仕込んであるボタンを押すと500エラーになってしまいます。

Apache

1[Thu Jan 28 14:24:42.053075 2021] [core:error] [pid 5869] [client 192.168.33.1:57109] 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., referer: http://192.168.33.10/

上記の言うとおりにhttpd.confにLogLevel debugを追加するとapacheを立ち上げた時点でいかが出力されます。

Apache

1[Thu Jan 28 14:50:19.772698 2021] [suexec:notice] [pid 5992] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) 2AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message 3[Thu Jan 28 14:50:19.793878 2021] [slotmem_shm:debug] [pid 5992] mod_slotmem_shm.c(448): AH02301: attach looking for /run/httpd/slotmem-shm-mod_heartmonitor.shm 4[Thu Jan 28 14:50:19.793902 2021] [lbmethod_heartbeat:notice] [pid 5992] AH02282: No slotmem from mod_heartmonitor 5[Thu Jan 28 14:50:19.818106 2021] [mpm_prefork:notice] [pid 5992] AH00163: Apache/2.4.6 (CentOS) PHP/8.0.1 configured -- resuming normal operations 6[Thu Jan 28 14:50:19.818131 2021] [mpm_prefork:info] [pid 5992] AH00164: Server built: Nov 16 2020 16:18:20 7[Thu Jan 28 14:50:19.818140 2021] [core:notice] [pid 5992] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' 8[Thu Jan 28 14:50:19.818151 2021] [mpm_prefork:debug] [pid 5992] prefork.c(1005): AH00165: Accept mutex: sysvsem (default: sysvsem) 9[Thu Jan 28 14:50:19.822871 2021] [proxy:debug] [pid 5995] proxy_util.c(1843): AH00925: initializing worker proxy:reverse shared 10[Thu Jan 28 14:50:19.822918 2021] [proxy:debug] [pid 5995] proxy_util.c(1888): AH00927: initializing worker proxy:reverse local 11[Thu Jan 28 14:50:19.822935 2021] [proxy:debug] [pid 5995] proxy_util.c(1939): AH00931: initialized single connection worker in child 5995 for (*) 12同じのがインクリメントされて続くchild 5996 for (*)

つぎに192.168.33.10にアクセスするといかが出力されました。

Apache

1[Thu Jan 28 14:53:53.352236 2021] [authz_core:debug] [pid 5995] mod_authz_core.c(809): [client 192.168.33.1:58130] AH01626: authorization resu 2lt of Require all granted: granted 3[Thu Jan 28 14:53:53.352266 2021] [authz_core:debug] [pid 5995] mod_authz_core.c(809): [client 192.168.33.1:58130] AH01626: authorization result of <RequireAny>: granted 4[Thu Jan 28 14:53:53.352341 2021] [authz_core:debug] [pid 5995] mod_authz_core.c(809): [client 192.168.33.1:58130] AH01626: authorization result of Require all granted: granted 5[Thu Jan 28 14:53:53.352345 2021] [authz_core:debug] [pid 5995] mod_authz_core.c(809): [client 192.168.33.1:58130] AH01626: authorization result of <RequireAny>: granted 6[Thu Jan 28 14:53:53.352384 2021] [authz_core:debug] [pid 5995] mod_authz_core.c(809): [client 192.168.33.1:58130] AH01626: authorization result of Require all granted: granted 7[Thu Jan 28 14:53:53.352396 2021] [authz_core:debug] [pid 5995] mod_authz_core.c(809): [client 192.168.33.1:58130] AH01626: authorization result of <RequireAny>: granted 8[Thu Jan 28 14:53:53.551983 2021] [authz_core:debug] [pid 5995] mod_authz_core.c(809): [client 192.168.33.1:58130] AH01626: authorization result of Require all granted: granted, referer: http://192.168.33.10/ 9[Thu Jan 28 14:53:53.552003 2021] [authz_core:debug] [pid 5995] mod_authz_core.c(809): [client 192.168.33.1:58130] AH01626: authorization result of <RequireAny>: granted, referer: http://192.168.33.10/ 10[Thu Jan 28 14:53:53.561970 2021] [authz_core:debug] [pid 5996] mod_authz_core.c(809): [client 192.168.33.1:58129] AH01626: authorization result of Require all granted: granted, referer: http://192.168.33.10/ 11[Thu Jan 28 14:53:53.561999 2021] [authz_core:debug] [pid 5996] mod_authz_core.c(809): [client 192.168.33.1:58129] AH01626: authorization result of <RequireAny>: granted, referer: http://192.168.33.10/ 12[Thu Jan 28 14:53:53.563937 2021] [authz_core:debug] [pid 5997] mod_authz_core.c(809): [client 192.168.33.1:58133] AH01626: authorization result of Require all granted: granted, referer: http://192.168.33.10/ 13[Thu Jan 28 14:53:53.563964 2021] [authz_core:debug] [pid 5997] mod_authz_core.c(809): [client 192.168.33.1:58133] AH01626: authorization result of <RequireAny>: granted, referer: http://192.168.33.10/ 14[Thu Jan 28 14:53:53.565752 2021] [authz_core:debug] [pid 5998] mod_authz_core.c(809): [client 192.168.33.1:58134] AH01626: authorization result of Require all granted: granted, referer: http://192.168.33.10/ 15[Thu Jan 28 14:53:53.565779 2021] [authz_core:debug] [pid 5998] mod_authz_core.c(809): [client 192.168.33.1:58134] AH01626: authorization result of <RequireAny>: granted, referer: http://192.168.33.10/ 16[Thu Jan 28 14:53:53.567919 2021] [authz_core:debug] [pid 5994] mod_authz_core.c(809): [client 192.168.33.1:58135] AH01626: authorization result of Require all granted: granted, referer: http://192.168.33.10/ 17[Thu Jan 28 14:53:53.567948 2021] [authz_core:debug] [pid 5994] mod_authz_core.c(809): [client 192.168.33.1:58135] AH01626: authorization result of <RequireAny>: granted, referer: http://192.168.33.10/ 18[Thu Jan 28 14:53:53.647657 2021] [authz_core:debug] [pid 5994] mod_authz_core.c(809): [client 192.168.33.1:58135] AH01626: authorization result of Require all granted: granted, referer: http://192.168.33.10/ 19[Thu Jan 28 14:53:53.647674 2021] [authz_core:debug] [pid 5994] mod_authz_core.c(809): [client 192.168.33.1:58135] AH01626: authorization result of <RequireAny>: granted, referer: http://192.168.33.10/ 20[Thu Jan 28 14:53:53.663357 2021] [authz_core:debug] [pid 5994] mod_authz_core.c(809): [client 192.168.33.1:58135] AH01626: authorization result of Require all granted: granted, referer: http://192.168.33.10/

exceeded the limitのエラーで調べてみると以下の様な設定が出てきますが、.htaccessですでに設定されてるので問題ないかと思います。
http://blog.livedoor.jp/tora0092-tech/archives/13978420.html

/var/www/html/TimeManager/public/.htaccess

1 <IfModule mod_rewrite.c> 2 <IfModule mod_negotiation.c> 3 Options -MultiViews -Indexes 4 </IfModule> 5 6 RewriteEngine On 7 8 # Handle Authorization Header 9 RewriteCond %{HTTP:Authorization} . 10 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 12 # Redirect Trailing Slashes If Not A Folder... 13 RewriteCond %{REQUEST_FILENAME} !-d 14 RewriteCond %{REQUEST_URI} (.+)/$ 15 RewriteRule ^ %1 [L,R=301] 16 17 # Send Requests To Front Controller... 18 RewriteCond %{REQUEST_FILENAME} !-d 19 RewriteCond %{REQUEST_FILENAME} !-f 20 RewriteRule ^ index.php [L] 21 </IfModule>

httpd.conf

httpd.conf

1 1 ServerRoot "/etc/httpd" 2 2 Listen 80 3 3 Include conf.modules.d/*.conf 4 4 User apache 5 5 Group apache 6 6 ServerAdmin root@localhost 7 7 <Directory /> 8 8 AllowOverride none 9 9 Require all denied 10 10 </Directory> 11 11 DocumentRoot "/var/www/html" 12 12 <Directory "/var/www"> 13 13 AllowOverride None 14 14 Require all granted 15 15 </Directory> 16 16 <Directory "/var/www/html"> 17 17 Options Indexes FollowSymLinks 18 18 AllowOverride None 19 19 Require all granted 20 20 </Directory> 21 21 <IfModule dir_module> 22 22 DirectoryIndex index.html 23 23 </IfModule> 24 24 <Files ".ht*"> 25 25 Require all denied 26 26 </Files> 27 27 ErrorLog "logs/error_log" 28 28 LogLevel warn 29 29 <IfModule log_config_module> 30 30 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 31 31 LogFormat "%h %l %u %t \"%r\" %>s %b" common 32 32 <IfModule logio_module> 33 33 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio 34 34 </IfModule> 35 35 CustomLog "logs/access_log" combined 36 36 </IfModule> 37 37 <IfModule alias_module> 38 38 ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" 39 39 </IfModule> 40 40 <Directory "/var/www/cgi-bin"> 41 41 AllowOverride None 42 42 Options None 43 43 Require all granted 44 44 </Directory> 45 45 <IfModule mime_module> 46 46 TypesConfig /etc/mime.types 47 47 AddType application/x-compress .Z 48 48 AddType application/x-gzip .gz .tgz 49 49 AddType text/html .shtml 50 50 AddOutputFilter INCLUDES .shtml 51 51 </IfModule> 52 52 AddDefaultCharset UTF-8 53 53 <IfModule mime_magic_module> 54 54 MIMEMagicFile conf/magic 55 55 </IfModule> 56 56 EnableSendfile on 57 57 IncludeOptional conf.d/*.conf 58 58 Alias / "/var/www/html/TimeManager/public/" 59 59 <Directory "/var/www/html/TimeManager/public/"> 60 60 Options FollowSymLinks MultiViews 61 61 AllowOverride All 62 62 Order allow,deny 63 63 Allow from all 64 64 Require all granted 65 65 </Directory>

ご教示頂ければ幸いです。よろしくお願いいたします。

環境 Apache2.4
Centos7
PHP8
Laravel Framework 8.24.0

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

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

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

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

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

m.ts10806

2021/01/29 01:30

タグにLaravelはあったほうが良いかと
guest

回答1

0

ベストアンサー

Apacheのrewritelogの出力方法(Apache2.2とApache2.4で違います) - Qiita
リダイレクトが関わるところで定義が間違っていて、ぐるぐる回ってます。
ログ出力を強化して、mod_rewrite周りの情報を足せば、追えるようになるかと。

投稿2021/01/29 00:06

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

navca

2021/01/29 08:28

回答ありがとうございます。Laravel7と8のhttpd.confを見比べたところRewriteBase /が8でなかったので追記したところうまくいきました。
navca

2021/01/29 08:36

httpd.confではなく.htaccessでした。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問