Skip to content
Advertisement

Symfony – (1/1) InvalidConfigurationException – Unrecognized option “mailer” under “framework”

I’m quite new at Symfony and struggle with this issue for my internship, when trying to run the project locally :

(1/1) InvalidConfigurationException        
 In ArrayNode.php line 331:                                                                                                                                                                                                                                     
      Unrecognized option "mailer" under "framework". Available options are "annotations", "assets", "cache", [...], "workflows".

I’m running PHP 7.4 and Symfony 4, adapting a symfony project from another dev.

In my .env file, I got swiftmailer bundle, I believe mailer was a different kind of mailer bundle used..?

I tried the following request :

 composer require symfony/mailer

And got this :

    The "symfony/flex" plugin was skipped because it is not compatible with Composer 2+. Make sure to update it to version 1.9.8 or greater.
Using version ^5.2 for symfony/mailer
./composer.json has been updated
The "symfony/flex" plugin was skipped because it is not compatible with Composer 2+. Make sure to update it to version 1.9.8 or greater.
Running composer update symfony/mailer
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/mailer[v5.2.0, ..., v5.2.2] require symfony/event-dispatcher ^4.4|^5.0 -> found symfony/event-dispatcher[v4.4.0, ..., v4.4.19, v5.0.0, ..., v5.2.2] but the package is fixed to v4.2.8 (lock file version) by a partial up
date and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires symfony/mailer ^5.2 -> satisfiable by symfony/mailer[v5.2.0, v5.2.1, v5.2.2].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Thanks for your help !

Advertisement

Answer

If you’re kickstarting another dev’s project, you probably don’t need any composer require. All you have to do is run composer install in project directory to get all the same packages, as previous developer.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement