How To Fix Laravel 4.0 – 4.1 Upgrade

Recently I’ve upgraded a Laravel 4 application from version 4.0.10 to 4.1.18. Despite Laravel’s website having a nice upgrade guide I did encounter few quirks that needed a little attention and some extra work.

So the very first thing to do, would be to follow the mentioned guide, hopefully you’ll end up with working new version of your application and wouldn’t need anything else (use “php artisan” command in your application folder to check out the current Laravel version).

Though I ended up with the following error each time I tried to run an artisan command (including simple “php artisan”):

PHP Fatal error: Class 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider' not found ...

And there were indeed no ConsoleSupportServiceProvider in my installation. Surely “composer.phar update” did not work as well as it tries to execute “php artisan …” commands and suggested “composer.phar update –no-scripts” worked, but didn’t fix anything.

After a bit of research I ended up with a kind of “clean install” solution, so if you have the same or similar issue you may try following:

  1. After preparing your application according to the guide, go to your application folder and delete /vendor and /composer.lock files or (on Linux) run these commands from the application directory:
    rm -rf vendor
    rm composer.lock
  2. Now the whole framework part was removed while your root, /app and /public files remain “upgrade ready”, so that the new install of the framework files can be performed:
    composer.phar install

That did the trick for me. Before testing the new version of your application make sure to purge everything:
php artisan dump-autoload
php artisan cache:clear
composer.phar dumpautoload

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.