Upgrading Symfony Framework from 4.0 to 4.1

With the release of Symfony Framework 4.1 a lot of interesting updates are available. Here is an overview on how to update your Symfony 4.0 project to Symfony 4.1. If you need to upgrade from a different major version than 4, please refer to this tutorial.

  1. Be sure that your code is compatible with Symfony 4.1. Some methods and processes changed. Read the upgrade notes and apply the suggested changes.
  2. In your “composer.json” file:
    Change the version of “symfony/framework-bundle” to “^4.1”
  3. run on command line:
composer update --with-dependencies symfony/framework-bundle

This will also update all depending packages to the required versions.

Edit (thanks for the hint Alex Rock):

If you want to get all symfony bundles to the latest version run:

composer update --with-dependencies symfony/*