Laravel 5 on php artisan config:clear generated Closure::__set_state() error

后端 未结 7 988
情书的邮戳
情书的邮戳 2020-12-24 02:50

My code in on production and I ran

php artisan config:clear

After that, my code was not running. The index pages and all other pages went

7条回答
  •  攒了一身酷
    2020-12-24 03:28

    Among other root-causes, this error results from calling php artisan config:cache when a closure is defined inside any configuration file that Laravel attempts to load. Laravel does not allow for closures in configuration files; see:

    https://github.com/laravel/framework/issues/9625

    Deleting the resultant cache file, usually located at bootstrap/cache/config.php, "fixes" the error.

    The long-term solution is to eliminate closures from all configuration files. The problematic config file can be determined by inspecting the offending line, as mentioned in the error message.

    If the offending file is third-party, it is best to open an issue with the library, so that the issue is fixed upstream.

提交回复
热议问题