{"id":169,"date":"2021-10-30T12:35:51","date_gmt":"2021-10-30T03:35:51","guid":{"rendered":"https:\/\/software.satoshis.jp\/?p=169"},"modified":"2021-10-30T12:35:51","modified_gmt":"2021-10-30T03:35:51","slug":"php-fatal-error-uncaught-reflectionexception-class-env-does-not-exist-in-var-www-hoge-vendor-laravel-framework-src-illuminate-container-container-php877-%e3%81%ae%e8%a7%a3%e6%b1%ba%e6%96%b9","status":"publish","type":"post","link":"https:\/\/software.satoshis.jp\/?p=169","title":{"rendered":"PHP Fatal error:  Uncaught ReflectionException: Class \"env\" does not exist in \/var\/www\/hoge\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php:877 \u306e\u89e3\u6c7a\u65b9\u6cd5"},"content":{"rendered":"<p>\u65e2\u5b58\u306eLaravel\u306e\u30b5\u30a4\u30c8\u3067\u3001\u4eca\u307e\u3067\u52d5\u3044\u3066\u305f\u306e\u306b\u3044\u304d\u306a\u308a\u30a8\u30e9\u30fc\u753b\u9762\u306b\u306a\u3063\u3066\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u305c\u3063\u3063\u3063\uff01<\/p>\n<p>storage\/log\/laravel.log \u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPHP Fatal error:  Uncaught ReflectionException: Class &quot;env&quot; does not exist in \/var\/www\/hoge\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php:877\r\n<\/pre>\n<p>\u307f\u305f\u3044\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u307e\u3059\u3002<\/p>\n<p>\u3050\u3050\u3063\u3066\u307f\u305f\u3089\u3001composer update \u3059\u308c\u3070\u89e3\u6c7a\u3059\u308b\u3068\u304b\u3001composer dump-autoload -o \u3059\u308c\u3070\u3044\u3044\u3068\u304b\u3001\u3044\u308d\u3044\u308d\u3042\u3063\u305f\u3051\u3069\u3069\u308c\u3082\u89e3\u6c7a\u3067\u304d\u305a\u3002<\/p>\n<p>\u3044\u308d\u3044\u308d\u3068\u8a66\u884c\u932f\u8aa4\u3057\u3066\u306f\u3050\u3050\u3063\u305f\u308a\u3057\u3066\u89e3\u6c7a\u65b9\u6cd5\u3092\u63a2\u3063\u3066\u308b\u3068\u3001\u4f8b\u5916\u304c\u51fa\u3066\u3044\u308b\u3068\u3053\u308d\u3067 dd($exception) \u3059\u308c\u3070\u539f\u56e0\u304c\u53d6\u308c\u305d\u3046\u3060\u3068\u3044\u3046\u60c5\u5831\u3092\u767a\u898b\u3002<\/p>\n<p>\u3053\u308c\u307e\u3067\u306e\u8a18\u9332\u3092\u3057\u3066\u306a\u3044\u306e\u3067\u3001\u3069\u3046\u3084\u3063\u3066\u884c\u304d\u5f53\u305f\u3063\u305f\u306e\u304b\u8a18\u61b6\u304c\u306a\u3044\u3093\u3060\u3051\u3069\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u30ed\u30b0\u3092\u9006\u30b9\u30af\u30ed\u30fc\u30eb\u3057\u3066\u898b\u8fd4\u3057\u3066\u307f\u308b\u3068\u3001app\/Exceptions\/Handler.php \u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u305f\u3076\u3093\u3053\u3053\u3067\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [3]; title: ; notranslate\" title=\"\">\r\n    public function report(Throwable $exception)\r\n    {\r\n        dd($exception);\r\n        parent::report($exception);\r\n    }\r\n<\/pre>\n<p>\u3053\u308c\u3092\u8ffd\u52a0\u3057\u3066composer\u3092\u5b9f\u884c\u3057\u305f\u3068\u3053\u308d\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ composer dump-autoload -o\r\nGenerating optimized autoload files\r\n&gt; Illuminate\\Foundation\\ComposerScripts::postAutoloadDump\r\n&gt; @php artisan package:discover\r\n^ ReflectionException {#54\r\n  #message: &quot;Class &quot;env&quot; does not exist&quot;\r\n  #code: -1\r\n  #file: &quot;.\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php&quot;\r\n  #line: 877\r\n  trace: {\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php:877 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php:758 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php:841 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php:694 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php:826 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php:1425 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Application.php:631 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Log\/LogManager.php:523 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Log\/LogManager.php:109 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Log\/LogManager.php:581 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Exceptions\/Handler.php:252 { \u2026}\r\n    .\/app\/Exceptions\/Handler.php:40 {\r\n      App\\Exceptions\\Handler-&gt;report(Throwable $exception)^\r\n      \u203a {\r\n      \u203a     parent::report($exception);\r\n      \u203a }\r\n    }\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Console\/Kernel.php:366 { \u2026}\r\n    .\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Console\/Kernel.php:131 { \u2026}\r\n    .\/artisan:37 { \u2026}\r\n  }\r\n}\r\n<\/pre>\n<p>\u65b0\u3057\u3044\u60c5\u5831\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n  #file: &quot;.\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php&quot;\r\n  #line: 877\r\n<\/pre>\n<p>.\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php\u3000\u306b\u3082\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: php; first-line: 876; highlight: [879,880]; title: ; notranslate\" title=\"\">\r\n        try {\r\n            $reflector = new ReflectionClass($concrete);\r\n        } catch (ReflectionException $e) {\r\n            debug_print_backtrace(10);\r\n            dd($e);\r\n            throw new BindingResolutionException(&quot;Target class &#x5B;$concrete] does not exist.&quot;, 0, $e);\r\n        }\r\n<\/pre>\n<p>composer\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ composer dump-autoload -o\r\nGenerating optimized autoload files\r\n&gt; Illuminate\\Foundation\\ComposerScripts::postAutoloadDump\r\n&gt; @php artisan package:discover\r\n\r\nIn cache.php line 91:\r\n\r\n  Call to undefined function str_slug()\r\n\r\n\r\nScript @php artisan package:discover handling the post-autoload-dump event returned with error code 1\r\n<\/pre>\n<p>\u30ad\u30bf\u30fc\uff01\uff01\uff01\uff01<\/p>\n<p>str_slug() \u95a2\u6570\u3092\u4f7f\u3063\u3066\u308b\u3068\u3053\u308d\u3092 grep \u3067\u63a2\u3057\u307e\u3059\u3002<\/p>\n<p>config\/cache.php \u3068 config\/session.php \u3067\u4f7f\u3063\u3066\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n    str_slug()\r\n<\/pre>\n<p>\u3092<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nuse Illuminate\\Support\\Str;\r\n\r\n(\u7565)\r\n    Str:slug(hoge)\r\n<\/pre>\n<p>\u306b\u5909\u66f4\u3057\u305f\u3089\u6b63\u5e38\u306b\u52d5\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65e2\u5b58\u306eLaravel\u306e\u30b5\u30a4\u30c8\u3067\u3001\u4eca\u307e\u3067\u52d5\u3044\u3066\u305f\u306e\u306b\u3044\u304d\u306a\u308a\u30a8\u30e9\u30fc\u753b\u9762\u306b\u306a\u3063\u3066\u307e\u3057\u305f\u3002 \u306a\u305c\u3063\u3063\u3063\uff01 storage\/log\/laravel.log \u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001 PHP Fatal error: U &#8230; <\/p>\n","protected":false},"author":1,"featured_media":63,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[42,14,58],"class_list":["post-169","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-composer","tag-laravel","tag-str_slug"],"nelio_content":{"autoShareEndMode":"never","automationSources":{"useCustomSentences":false,"customSentences":[]},"efiAlt":"","efiUrl":"","followers":[1],"highlights":[],"isAutoShareEnabled":true,"networkImageIds":[],"permalinkQueryArgs":[],"series":[],"suggestedReferences":[]},"views":14878,"_links":{"self":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=169"}],"version-history":[{"count":2,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions"}],"predecessor-version":[{"id":171,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions\/171"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/media\/63"}],"wp:attachment":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}