前提
現在、Vue.js+Laravelのアプリをローカル環境で作成したアプリをxserverにデプロイしようとしています。
ローカル環境では問題なく動いていたアプリが本番環境に上げるとうまく動作しません。
もし原因をご存じの方がいらっしゃいましたらご教授願います。
本番URL:http://personal-development-contest.com/todolist/
エラー内容といたしましては、以下の画像のようにServer Error 500と出ています。
関係がありそうなファイルのソースコードを添付いたします。
app.js
1require('./bootstrap'); 2 3import { createApp } from 'vue' 4import App from './vue/app' 5import { library } from '@fortawesome/fontawesome-svg-core' 6import { faPlusSquare, faTrash } from '@fortawesome/free-solid-svg-icons' 7import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' 8 9library.add(faPlusSquare, faTrash) 10 11export const eventBus = createApp(App) 12createApp(App) 13 .component("font-awesome-icon", FontAwesomeIcon) 14 .mount('#app');
Package.json
1{ 2 "private": true, 3 "scripts": { 4 "dev": "npm run development", 5 "development": "mix", 6 "watch": "mix watch", 7 "watch-poll": "mix watch -- --watch-options-poll=1000", 8 "hot": "mix watch --hot", 9 "prod": "npm run production", 10 "production": "mix --production" 11 }, 12 "devDependencies": { 13 "@vue/compiler-sfc": "^3.2.33", 14 "axios": "^0.21", 15 "laravel-mix": "^6.0.6", 16 "lodash": "^4.17.19", 17 "postcss": "^8.1.14", 18 "vue-template-compiler": "^2.6.14" 19 }, 20 "dependencies": { 21 "@fortawesome/fontawesome-svg-core": "^6.1.1", 22 "@fortawesome/free-solid-svg-icons": "^6.1.1", 23 "@fortawesome/vue-fontawesome": "^3.0.0-5", 24 "vue": "^3.2.41", 25 "vue-loader": "^17.0.0" 26 } 27}
webpack.mix.js
1const mix = require('laravel-mix'); 2 3/* 4 |-------------------------------------------------------------------------- 5 | Mix Asset Management 6 |-------------------------------------------------------------------------- 7 | 8 | Mix provides a clean, fluent API for defining some Webpack build steps 9 | for your Laravel applications. By default, we are compiling the CSS 10 | file for the application as well as bundling up all the JS files. 11 | 12 */ 13 14mix.js('resources/js/app.js', 'public/js').vue() 15 .postCss('resources/css/app.css', 'public/css', [ 16 // 17 ]).vue();
npm run prod で本番ビルドまではできたのですが、表示されませんでした。
以上です。
宜しくお願いいたします。
補足情報(FW/ツールのバージョンなど)
PHP 8.1.2
Laravel 8
参考動画:https://youtu.be/UHSipe7pSac
追記
初心者すぎて申し訳ないのですが、本番DBとの接続ができていませんでした・・・
本番DBと接続後、エラー内容が変わったので添付いたします。
原因は調査中&エラーログの確認中です。
エラーログ
error.log
1[Wed Nov 09 04:34:11.927849 2022] [core:error] [pid 394359:tid 394867] [client 193.235.141.173:53138] 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. 2[Wed Nov 09 04:34:11.927878 2022] [core:error] [pid 394359:tid 394867] [client 193.235.141.173:53138] 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. 3[Wed Nov 09 04:34:12.805935 2022] [core:error] [pid 394359:tid 394887] [client 193.235.141.173:53316] 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. 4[Wed Nov 09 04:34:12.805964 2022] [core:error] [pid 394359:tid 394887] [client 193.235.141.173:53316] 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. 5[Wed Nov 09 06:51:37.110650 2022] [core:error] [pid 394357:tid 394791] [client 194.36.97.195:55806] 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. 6[Wed Nov 09 06:51:37.110673 2022] [core:error] [pid 394357:tid 394791] [client 194.36.97.195:55806] 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. 7[Wed Nov 09 08:13:28.443358 2022] [core:error] [pid 408782:tid 409077] [client 124.209.133.129:46756] 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: https://personal-development-contest.com/todolist/ 8[Wed Nov 09 08:13:28.443384 2022] [core:error] [pid 408782:tid 409077] [client 124.209.133.129:46756] 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: https://personal-development-contest.com/todolist/ 9[Wed Nov 09 08:13:53.335477 2022] [core:error] [pid 408781:tid 409266] [client 124.209.133.129:55124] 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: https://personal-development-contest.com/todolist/ 10[Wed Nov 09 08:13:53.335507 2022] [core:error] [pid 408781:tid 409266] [client 124.209.133.129:55124] 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: https://personal-development-contest.com/todolist/ 11[Wed Nov 09 08:14:31.681095 2022] [core:error] [pid 408783:tid 409018] [client 124.209.133.129:38472] 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: https://personal-development-contest.com/todolist/ 12[Wed Nov 09 08:14:31.681112 2022] [core:error] [pid 408783:tid 409018] [client 124.209.133.129:38472] 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: https://personal-development-contest.com/todolist/ 13[Wed Nov 09 08:14:33.384783 2022] [core:error] [pid 408781:tid 409029] [client 124.209.133.129:39096] 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: https://personal-development-contest.com/todolist/ 14[Wed Nov 09 08:14:33.384829 2022] [core:error] [pid 408781:tid 409029] [client 124.209.133.129:39096] 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: https://personal-development-contest.com/todolist/ 15[Wed Nov 09 08:14:50.373502 2022] [core:error] [pid 408783:tid 408925] [client 124.209.133.129:43942] 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: https://personal-development-contest.com/todolist/ 16[Wed Nov 09 08:14:50.373519 2022] [core:error] [pid 408783:tid 408925] [client 124.209.133.129:43942] 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: https://personal-development-contest.com/todolist/
追記2
開発者ツールを開いた状態で更新した場合
追記3
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On **RewriteBase /todolist** # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
追記
webpack.mix.jsに以下のソースコードを追加してもダメでした。
mix.setResourceRoot('/todolist/');
補足情報として以下の画像のようにシンボリックリンクを設定しています。
public_htmlのあとに/todolist/を追加している理由はxserverだとうまく設定できないからです。
参考URL:https://brainlog.jp/programming/laravel/post-1287/
回答2件
あなたの回答
tips
プレビュー