我的应用后端突然停止工作,返回500HTTP错误和laravel.log中的这个错误:
[2020-09-16 12:28:15] local.ERROR: Uncaught Error: Class 'Illuminate\Http\Response' not found in /home/.../vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php:424
[2020-09-16 12:28:19] local.ERROR: Class 'Illuminate\Http\Response' not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'Illuminate\\Http\\Response' not found at /home/../vendor/laravel/framework/src/Illuminate/Routing/Router.php:751)
Laravel版本为5.8.37
有人知道会出什么问题吗?
我试过chmod -R 777 storage/,php artisan cache:clear,php artisan config:clear和composer dump-autoload,都不起作用。
提前谢谢你!
编辑:删除供应商文件夹并运行下面的命令修复了这个问题,但是我注意到在composer dump-autoload过程中出现了一些错误。
composer install
以下是显示的错误:
Deprecation Notice: Class Twilio\TwiML\Voice\Echo_ located in ./vendor/twilio/sdk/src/Twilio/TwiML/Voice/Echo.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class ConsoleTVs\Support\Traits\StringFUnctions located in ./vendor/consoletvs/support/Traits/StringFunctions.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class App\Http\Controllers\BonusCardController located in ./app/Http/Controllers/Api/V1/BonusCardController.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class App\UserPartner located in ./app/Models/UserPartner.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class App\UserMarathon located in ./app/Models/UserMarathon.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
谢谢!
发布于 2020-09-16 09:55:31
看起来你的vendor
文件夹有问题,所以删除旧的vendor
文件夹
运行cmd composer install
,然后运行composer dump-autoload
在这里,composer install
将安装项目的所有依赖项,composer dump-autoload
将加载处理这些依赖项所需的所有文件
https://stackoverflow.com/questions/63917287
复制