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

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

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

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

PHP

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

artisan

artisanは、PHP Laravelフレームワークのコマンドの事です。 Artisanコマンドを使う事で、DBのテーブルやバンドル等を追加することができるコマンドです。

Q&A

1回答

3794閲覧

【laravel】php artisan config:cache 実行したことによってサーバーが立ち上がらなくなった。

s_tatsuki

総合スコア44

Laravel

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

PHP

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

artisan

artisanは、PHP Laravelフレームワークのコマンドの事です。 Artisanコマンドを使う事で、DBのテーブルやバンドル等を追加することができるコマンドです。

0グッド

0クリップ

投稿2020/03/10 10:38

前提・実現したいこと

以前のようにローカルでサーバーを立ち上げたい。

発生している問題・エラーメッセージ

php artisan serve #実行すると、、、 PHP Warning: A non-numeric value encountered in /Users/shiga1/git/training_customer_app/config/app.php on line 16 Warning: A non-numeric value encountered in /Users/shiga1/git/training_customer_app/config/app.php on line 16 In ProviderRepository.php line 208: Class name must be a valid object or a string

該当のソースコード

php

1#config/app.php 2<?php 3 4return [ 5 6 /* 7 |-------------------------------------------------------------------------- 8 | Application Name 9 |-------------------------------------------------------------------------- 10 | 11 | This value is the name of your application. This value is used when the 12 | framework needs to place the application's name in a notification or 13 | any other location as required by the application or its packages. 14 | 15 */ 16 17 'name' => env('APP_NAME', 'Laravel'), 18 19 /* 20 |-------------------------------------------------------------------------- 21 | Application Environment 22 |-------------------------------------------------------------------------- 23 | 24 | This value determines the "environment" your application is currently 25 | running in. This may determine how you prefer to configure various 26 | services the application utilizes. Set this in your ".env" file. 27 | 28 */ 29 30 'env' => env('APP_ENV', 'production'), 31 32 /* 33 |-------------------------------------------------------------------------- 34 | Application Debug Mode 35 |-------------------------------------------------------------------------- 36 | 37 | When your application is in debug mode, detailed error messages with 38 | stack traces will be shown on every error that occurs within your 39 | application. If disabled, a simple generic error page is shown. 40 | 41 */ 42 43 'debug' => env('APP_DEBUG', false), 44 45 /* 46 |-------------------------------------------------------------------------- 47 | Application URL 48 |-------------------------------------------------------------------------- 49 | 50 | This URL is used by the console to properly generate URLs when using 51 | the Artisan command line tool. You should set this to the root of 52 | your application so that it is used when running Artisan tasks. 53 | 54 */ 55 56 'url' => env('APP_URL', 'http://localhost'), 57 58 'asset_url' => env('ASSET_URL', null), 59 60 /* 61 |-------------------------------------------------------------------------- 62 | Application Timezone 63 |-------------------------------------------------------------------------- 64 | 65 | Here you may specify the default timezone for your application, which 66 | will be used by the PHP date and date-time functions. We have gone 67 | ahead and set this to a sensible default for you out of the box. 68 | 69 */ 70 71 'timezone' => 'UTC', 72 73 /* 74 |-------------------------------------------------------------------------- 75 | Application Locale Configuration 76 |-------------------------------------------------------------------------- 77 | 78 | The application locale determines the default locale that will be used 79 | by the translation service provider. You are free to set this value 80 | to any of the locales which will be supported by the application. 81 | 82 */ 83 84 // 'locale' => 'en', 85 'locale' => 'ja', // 日本語言語ファイルの呼び出し 86 87 88 /* 89 |-------------------------------------------------------------------------- 90 | Application Fallback Locale 91 |-------------------------------------------------------------------------- 92 | 93 | The fallback locale determines the locale to use when the current one 94 | is not available. You may change the value to correspond to any of 95 | the language folders that are provided through your application. 96 | 97 */ 98 99 'fallback_locale' => 'en', 100 101 /* 102 |-------------------------------------------------------------------------- 103 | Faker Locale 104 |-------------------------------------------------------------------------- 105 | 106 | This locale will be used by the Faker PHP library when generating fake 107 | data for your database seeds. For example, this will be used to get 108 | localized telephone numbers, street address information and more. 109 | 110 */ 111 112 'faker_locale' => env('DEV_FAKER_LOCALE', 'en_US'), 113 114 /* 115 |-------------------------------------------------------------------------- 116 | Encryption Key 117 |-------------------------------------------------------------------------- 118 | 119 | This key is used by the Illuminate encrypter service and should be set 120 | to a random, 32 character string, otherwise these encrypted strings 121 | will not be safe. Please do this before deploying an application! 122 | 123 */ 124 125 'key' => env('APP_KEY'), 126 127 'cipher' => 'AES-256-CBC', 128 129 /* 130 |-------------------------------------------------------------------------- 131 | Autoloaded Service Providers 132 |-------------------------------------------------------------------------- 133 | 134 | The service providers listed here will be automatically loaded on the 135 | request to your application. Feel free to add your own services to 136 | this array to grant expanded functionality to your applications. 137 | 138 */ 139 140 'providers' => [ 141 142 /* 143 * Laravel Framework Service Providers... 144 */ 145 Illuminate\Auth\AuthServiceProvider::class, 146 Illuminate\Broadcasting\BroadcastServiceProvider::class, 147 Illuminate\Bus\BusServiceProvider::class, 148     省略 149 150 /* 151 * Package Service Providers... 152 */ 153 154 /* 155 * Application Service Providers... 156 */ 157 App\Providers\AppServiceProvider::class, 158 App\Providers\AuthServiceProvider::class, 159 // App\Providers\BroadcastServiceProvider::class, 160 App\Providers\EventServiceProvider::class, 161 App\Providers\RouteServiceProvider::class, 162 163 ], 164 165 /* 166 |-------------------------------------------------------------------------- 167 | Class Aliases 168 |-------------------------------------------------------------------------- 169 | 170 | This array of class aliases will be registered when this application 171 | is started. However, feel free to register as many as you wish as 172 | the aliases are "lazy" loaded so they don't hinder performance. 173 | 174 */ 175 176 'aliases' => [ 177 178 'App' => Illuminate\Support\Facades\App::class, 179 'Arr' => Illuminate\Support\Arr::class, 180 'Artisan' => Illuminate\Support\Facades\Artisan::class, 181 'Auth' => Illuminate\Support\Facades\Auth::class, 182 'Blade' => Illuminate\Support\Facades\Blade::class, 183 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 184 'Bus' => Illuminate\Support\Facades\Bus::class, 185 'Cache' => Illuminate\Support\Facades\Cache::class, 186 'Config' => Illuminate\Support\Facades\Config::class, 187     省略 188 ], 189 190];
#.envファイル APP_NAME=Laravel APP_ENV=local APP_KEY=base64:OhzoxRplH+63rZyyH+hbdusUC+AtMgYdmW61ivNs8Zs= APP_DEBUG=true APP_URL=http://localhost LOG_CHANNEL=stack DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=toremane DB_USERNAME=root DB_PASSWORD= BROADCAST_DRIVER=log CACHE_DRIVER=file QUEUE_CONNECTION=sync SESSION_DRIVER=file SESSION_LIFETIME=120 REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_MAILER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS=null MAIL_FROM_NAME="${APP_NAME}" AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_APP_CLUSTER=mt1 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" DEV_FAKER_LOCALE=ja_JP

試したこと

調べた結果、このコマンドを実行すると、env()からはnullしか返さなくなることを知りました。
試したこととして、元に戻す方法を調べましたが、どうやら新しいプロジェクトを作って移すしかなさそうで大変困ってます。

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

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

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

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

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

退会済みユーザー

退会済みユーザー

2020/03/10 12:38

余計な文字がはいってるから、言語コードがないっておちじゃね DEV_FAKER_LOCALE=ja_JP
s_tatsuki

2020/03/11 01:19

回答ありがとうございます。 削除して試みましたがダメでした。
guest

回答1

0

キャッシュの削除自体はphp artisan config:clearでいいけど
エラー出てるならそもそもキャッシュできてない。

投稿2020/03/10 10:49

編集2020/03/10 12:20
kawax

総合スコア10377

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

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

s_tatsuki

2020/03/10 11:23

回答いただきありがとうございます。 php artisan cache:clear は 1回目の実行は通りました。 2回目以降は、投稿した内容のエラーがでます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問