手动清除已编译的类 - Laravel

时间:2017-08-04 04:26:31

标签: php laravel

我在更新代码库后收到错误,但我似乎无法绕过它。我使用了一个我不再使用的软件包,我经过了removing the package like this answer的正确步骤,但我在控制台中所做的任何事情都失败了。

我试过跑:

composer update

但是我收到了这个错误:

user@my-app:~/example.com$ php artisan clear-compiled
PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Travoltron\Plaid\PlaidServiceProvider' not found in /home/user/example.com/bootstrap/cache/compiled.php:7825
Stack trace:
#0 /home/user/example.com/bootstrap/cache/compiled.php(7811): Illuminate\Foundation\ProviderRepository->createProvider('Travoltron\\Plai...')
#1 /home/user/example.com/bootstrap/cache/compiled.php(7787): Illuminate\Foundation\ProviderRepository->compileManifest(Array)
#2 /home/user/example.com/bootstrap/cache/compiled.php(1937): Illuminate\Foundation\ProviderRepository->load(Array)
#3 /home/user/example.com/bootstrap/cache/compiled.php(2357): Illuminate\Foundation\Application->registerConfiguredProviders()
#4 /home/user/example.com/bootstrap/cache/compiled.php(1796): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
#5 /home/user/example.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kerne in /home/user/example.com/bootstrap/cache/compiled.php on line 7825
PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Travoltron\Plaid\PlaidServiceProvider' not found in /home/user/example.com/bootstrap/cache/compiled.php:7825
Stack trace:
#0 /home/user/example.com/bootstrap/cache/compiled.php(7811): Illuminate\Foundation\ProviderRepository->createProvider('Travoltron\\Plai...')
#1 /home/user/example.com/bootstrap/cache/compiled.php(7787): Illuminate\Foundation\ProviderRepository->compileManifest(Array)
#2 /home/user/example.com/bootstrap/cache/compiled.php(1937): Illuminate\Foundation\ProviderRepository->load(Array)
#3 /home/user/example.com/bootstrap/cache/compiled.php(2357): Illuminate\Foundation\Application->registerConfiguredProviders()
#4 /home/user/example.com/bootstrap/cache/compiled.php(1796): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
#5 /home/user/example.com/ in /home/user/example.com/bootstrap/cache/compiled.php on line 7825

我已经尝试过运行这些命令但收到同样的错误:

composer install
composer dump-autoload
php artisan config:cache
php artisan config:clear
php artisan clear-compiled

我的问题是,,因为这看起来只是拿起编译类的缓存版本有没有办法手动删除已编译的缓存,因为我无法绕过它通过命令?

1 个答案:

答案 0 :(得分:1)

您可以删除 /bootstrap/cache 中存在的所有缓存文件并再次自动加载 Composer。

进入应用程序目录后运行以下命令。

rm -r bootstrap/cache/*
composer dump-autoload