gpt4 book ai didi

拉拉维尔 5.2 : Class 'Intervention\Image\ImageServiceProvider' not found

转载 作者:行者123 更新时间:2023-12-02 10:25:04 28 4
gpt4 key购买 nike

我正在尝试将干预图像集成到我的项目中。我遵循了该指南,使用了很多其他教程,无论我做什么,我总是遇到同样的错误:

Class 'Intervention\Image\ImageServiceProvider' not found

它包含在我的 composer.json 中:

{
"require": {
"laravel/envoy": "~1.0",
"laravel/installer": "^1.3",
"intervention/image": "^2.3"
}
}

我已经安装了 php-gd 东西,我包括了

Intervention\Image\ImageServiceProvider::class

'Image' => Intervention\Image\Facades\Image::class

在我的config\app.php中,但我不断收到烦人的错误消息。也许值得一提的是,我使用的是 Linux Mint 操作系统,并且我正在使用 Homestead 虚拟机。是的,我将这些东西包含在 Homestead 版本的 Composer 中,而不是我的主 PC 的 Composer 中。使用时

PHP artisan --version

,它返回:

Laravel Framework version 5.2.43

我在虚拟机上运行了composer update,但没有解决问题。我尝试从 app.php 中删除这些行,运行composer update,再次添加这些行并运行composer update,但没有成功。

我在 config\app.php 中包含的内容有什么关系吗?现在,别名位于列表中,提供程序位于“包服务提供程序”下。

以下是完整的错误消息:

Whoops, looks like something went wrong.

1/1
FatalThrowableError in ProviderRepository.php line 146:
Class 'Intervention\Image\ImageServiceProvider' not found
in ProviderRepository.php line 146
at ProviderRepository->createProvider('Intervention\Image\ImageServiceProvider') in ProviderRepository.php line 114
at ProviderRepository->compileManifest(array('Illuminate\Auth\AuthServiceProvider', 'Illuminate\Broadcasting\BroadcastServiceProvider', 'Illuminate\Bus\BusServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Filesystem\FilesystemServiceProvider', 'Illuminate\Foundation\Providers\FoundationServiceProvider', 'Illuminate\Hashing\HashServiceProvider', 'Illuminate\Mail\MailServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Pipeline\PipelineServiceProvider', 'Illuminate\Queue\QueueServiceProvider', 'Illuminate\Redis\RedisServiceProvider', 'Illuminate\Auth\Passwords\PasswordResetServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Translation\TranslationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', 'Intervention\Image\ImageServiceProvider', 'App\Providers\AppServiceProvider', 'App\Providers\AuthServiceProvider', 'App\Providers\EventServiceProvider', 'App\Providers\RouteServiceProvider')) in ProviderRepository.php line 60
at ProviderRepository->load(array('Illuminate\Auth\AuthServiceProvider', 'Illuminate\Broadcasting\BroadcastServiceProvider', 'Illuminate\Bus\BusServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Filesystem\FilesystemServiceProvider', 'Illuminate\Foundation\Providers\FoundationServiceProvider', 'Illuminate\Hashing\HashServiceProvider', 'Illuminate\Mail\MailServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Pipeline\PipelineServiceProvider', 'Illuminate\Queue\QueueServiceProvider', 'Illuminate\Redis\RedisServiceProvider', 'Illuminate\Auth\Passwords\PasswordResetServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Translation\TranslationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', 'Intervention\Image\ImageServiceProvider', 'App\Providers\AppServiceProvider', 'App\Providers\AuthServiceProvider', 'App\Providers\EventServiceProvider', 'App\Providers\RouteServiceProvider')) in Application.php line 530
at Application->registerConfiguredProviders() in RegisterProviders.php line 17
at RegisterProviders->bootstrap(object(Application)) in Application.php line 203
at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 232
at Kernel->bootstrap() in Kernel.php line 127
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 53

最佳答案

我遇到了同样的问题,事实证明我没有在项目的根目录上运行此命令$ phpcomposer.phar require Intervention/image。我确实在项目的根目录上运行了它,一切都很好。

例如Itses-MacBook-Pro:testproject bigtank$ Composer 需要干预/图像

像这样运行它就会起作用。

干杯。

关于拉拉维尔 5.2 : Class 'Intervention\Image\ImageServiceProvider' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38921157/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com