Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
281 views
in Technique[技术] by (71.8m points)

php - Fatal error while upgrading Laravel 5.1 to 5.2

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

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

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

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

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

and

[SymfonyComponentDebugExceptionFatalErrorException]
Class 'IlluminateRoutingControllerServiceProvider' not found

and

[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.

What might be wrong?

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?

UPDATE

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is no IlluminateRoutingControllerServiceProvider any more.

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,

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...