无法从Laravel 5.8更新到6.5.0

时间:2019-11-12 10:41:17

标签: laravel upgrade

我正在尝试使用Docker将Laravel升级到最新版本 PHP 7.2 Ubuntu 16 Laravel 5.8及更新后,当我尝试运行与php artisan config:clear或任何php artisan相关的所有内容时,我会得到:

  

oot @ 88081fc77c2c:/ data / www / html#php artisan缓存:clear PHP致命   错误:未捕获ReflectionException:类配置不存在   /data/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:804   堆栈跟踪:#0   /data/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(804):   ReflectionClass-> __ construct('config')#1   /data/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(682):   Illuminate \ Container \ Container-> build('config')#2   /data/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(630):   Illuminate \ Container \ Container-> resolve('config',Array)#3   /data/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(768):   Illuminate \ Container \ Container-> make('config',Array)#4   /data/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(1246):   Illuminate \ Foundation \ Application-> make('config')#5   /data/www/html/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(62):   Illuminate \ Container \ Container-> offsetGet('config')#6   / data / www / html / vendor / aws / aws中   /data/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php   在第806行

如果我将此文件添加为boostrap / cache 作为返回的空数组,Laravel将无法识别视图类,数据库类等等。请帮忙!!!!

PS

1. added bootstrap/cache permissions
2. checked for empty spaces in the .env file
3. checked for , in the app/config.php file

3 个答案:

答案 0 :(得分:0)

在composer.json

"require": {

        "laravel/framework": "6.5.*",
            },

然后

composer install

答案 1 :(得分:0)

更改您的composer.json

"require": {
        "laravel/framework": "6.5.*",
 },

运行此命令

composer update

答案 2 :(得分:0)

谢谢您的回应,最后我才发现我的/bootstrap/app.php文件包含一些不必要的提供程序(应该在提供程序位置),并且在清理后可以解决

  

$ app =新的Illuminate \ Foundation \ Application(           realpath( DIR 。'/ .. /')       );

struct TestTwoAlerts: View {
    @State var alertIsVisible = false
    @State var bonusAlertIsVisible = false

    var score = 100
    var title = "First alert"

    var body: some View {
        VStack {
            Button(action: {
                 self.alertIsVisible = true
            }) {
                 Text("Hit Me!")
            }
            .alert(isPresented: $alertIsVisible) {
                Alert(title: Text("\(title)"), message: Text("\n"), dismissButton:.default(Text("Next Round"), action: {
                    if self.score == 100 {
                        DispatchQueue.main.async { // !! This part important !!
                            self.bonusAlertIsVisible = true
                        }
                    }
                }))
            }
            Text("")
            .alert(isPresented: $bonusAlertIsVisible) {
                    Alert(title: Text("Bonus"), message: Text("You've earned 100 points bonus!!"), dismissButton: .default(Text("Close")))
            }
        }
    }
}

struct TestTwoAlerts_Previews: PreviewProvider {
    static var previews: some View {
        TestTwoAlerts()
    }
}