简体   繁体   English

Laravel清除作曲家软件包的软件包自动发现缓存

[英]Laravel clear package auto-discovery cache of composer packages

I wanted to remove a package from laravel. 我想从laravel中删除一个软件包。 I did composer remove vendor/package 我做了composer remove vendor/package

It was all good on my dev, but when I deploy on production something went wrong and I cannot do anything now. 这对我的开发人员来说一切都很好,但是当我在生产环境中部署时出了点问题,现在我什么也做不了。

when I run 当我跑步时

php artisan package:discover

I'm geting 我正在

In ProviderRepository.php line 208: 在ProviderRepository.php第208行中:

Class 'Laracasts\\Flash\\FlashServiceProvider' not found 找不到类别“ Laracasts \\ Flash \\ FlashServiceProvider”

I'm guessing I it is something to do with some kind of cache or maby config 我猜我这与某种缓存或maby配置有关

but I cannot run this command, 但我无法运行此命令,

php artisan config:clear

because I'm getting the same error message as above. 因为我收到与上述相同的错误消息。

PS. PS。 I'm using Laravel 5.6 我正在使用Laravel 5.6

You may need clear the autoloader files if they get jammed up as it is looking at those cached files when php artisan config:clear runs, thus creating the jam. 如果自动加载程序文件在php artisan config:clear运行时正在查看那些缓存的文件时被卡住,则可能需要清除它们,从而造成卡纸。

Remove the following files and they will rebuild: /bootstrap/cache/packages.php /bootstrap/cache/services.php 删除以下文件,它们将重建: /bootstrap/cache/packages.php /bootstrap/cache/services.php

I fixed my problem deleting a config file like so: 我修复了删除配置文件的问题,如下所示:

$rm bootstrap/cache/config.php

This file is basically a cache for config, if you want to have this file built for you just run a following artisan command: 此文件基本上是config的缓存,如果您想为该文件构建,只需运行以下artisan命令即可:

$php artisan config:cache

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM