将 Laravel 5.1 升级到 5.2 时出现致命错误

Fatal error while upgrading Laravel 5.1 to 5.2(将 Laravel 5.1 升级到 5.2 时出现致命错误)
本文介绍了将 Laravel 5.1 升级到 5.2 时出现致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在遵循 5.1 的官方升级指南到 5.2.第一个小节说:

I'm following the official upgrade guide from 5.1 to 5.2. First sub-section says:

如果您要安装 Laravel 5.2 的测试版,请添加"minimum-stability": "beta" 到您的 composer.json 文件.

If you are installing a beta release of Laravel 5.2, add "minimum-stability": "beta" to your composer.json file.

更新您的 composer.json 文件以指向 laravel/framework 5.2.*.

Update your composer.json file to point to laravel/framework 5.2.*.

symfony/dom-crawler ~3.0symfony/css-selector ~3.0 添加到composer.json 文件的 require-dev 部分.

Add symfony/dom-crawler ~3.0 and symfony/css-selector ~3.0 to the require-dev section of your composer.json file.

现在,在我引入上述更改并运行 composer update 后,出现以下错误:

Now, after I introduce the above changes and run composer update, I get the following error(s):

PHP Fatal error:  Class 'IlluminateRoutingControllerServiceProvider' not found 
in /home/vagrant/Code/myproject/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146

[SymfonyComponentDebugExceptionFatalErrorException]
Class 'IlluminateRoutingControllerServiceProvider' not found

[RuntimeException]
Error Output: PHP Fatal error:  Class 'IlluminateRoutingControllerServiceProvider' not found in /home/vagrant/Code/myproject/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146

在更新完成后抛出错误,并发生生成自动加载文件".

The errors are thrown after the update is done, and "Generating autoload files" takes place.

可能有什么问题?

这看起来不像是自定义包问题,而是核心问题.我是否应该继续升级指南并在所有内容都已调整以适应新框架版本后运行 composer update?

It does not look like a custom package issue, but a core one. Should I continue with the upgrade guide and run composer update AFTER all has been adjusted to suit the new framework version?

更新

之后运行 composer dump-autoload 不会抛出上述错误.不过还是很困惑.

Running composer dump-autoload afterwards doesn't throw the errors described above. Still confusing, though.

推荐答案

不再有IlluminateRoutingControllerServiceProvider.

如果我是你,我会将我的应用项目与 https://github.com/laravel/laravel/commits/develop 进行比较,例如,如果您查看 https://github.com/laravel/laravel/blob/develop/config/app.php 你会看到 Laravel 5.2 的默认提供者:

If I were you, I would compare my app project to https://github.com/laravel/laravel/commits/develop, if you for example look at https://github.com/laravel/laravel/blob/develop/config/app.php you will see default providers for Laravel 5.2:

IlluminateAuthAuthServiceProvider::class,
IlluminateBroadcastingBroadcastServiceProvider::class,
IlluminateBusBusServiceProvider::class,
IlluminateCacheCacheServiceProvider::class,
IlluminateFoundationProvidersConsoleSupportServiceProvider::class,
IlluminateCookieCookieServiceProvider::class,
IlluminateDatabaseDatabaseServiceProvider::class,
IlluminateEncryptionEncryptionServiceProvider::class,
IlluminateFilesystemFilesystemServiceProvider::class,
IlluminateFoundationProvidersFoundationServiceProvider::class,
IlluminateHashingHashServiceProvider::class,
IlluminateMailMailServiceProvider::class,
IlluminatePaginationPaginationServiceProvider::class,
IlluminatePipelinePipelineServiceProvider::class,
IlluminateQueueQueueServiceProvider::class,
IlluminateRedisRedisServiceProvider::class,
IlluminateAuthPasswordsPasswordResetServiceProvider::class,
IlluminateSessionSessionServiceProvider::class,
IlluminateTranslationTranslationServiceProvider::class,
IlluminateValidationValidationServiceProvider::class,
IlluminateViewViewServiceProvider::class,
/*
 * Application Service Providers...
 */
AppProvidersAppServiceProvider::class,
AppProvidersAuthServiceProvider::class,
AppProvidersEventServiceProvider::class,
AppProvidersRouteServiceProvider::class,

这篇关于将 Laravel 5.1 升级到 5.2 时出现致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)