我的laravel项目在包含php依赖项Shopify/shopify-php: ^0.11.0
和执行php artisan配置缓存之后,在其开发环境中运行良好。一切都很顺利,直到我将同一个分支拉到另一个目录,并为新的依赖项安装了一个作曲家来反映。执行php artisan配置时出现以下错误:cache post install。我不知道从哪里开始调试它。
PHP Fatal error: Uncaught RuntimeException: A facade root has not been set.
in /home/apps/panel/v4.0.6/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:234
Stack trace:
#0 /home/apps/panel/v4.0.6/app/Exceptions/Handler.php(40): Illuminate\Support\Facades\Facade::__callStatic('has', Array)
#1 /home/apps/panel/v4.0.6/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(320): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#2 /home/apps/panel/v4.0.6/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\Foundation\Console\Kernel->reportException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#3 /home/apps/panel/v4.0.6/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
如果有帮助,这是我的gitignore
/node_modules
/public/storage
/vendor
/.idea
Homestead.json
Homestead.yaml
.env
public/.htaccess
还要检查具有较旧依赖项的分支,执行php artisan config:cache并返回到新分支并执行php artisan config:cache工作正常。
答案 0 :(得分:0)
在composer dump-autoload
php artisan config:cache