Learn how to solve this exception when trying to install the dependencies of your PHP project.

After trying to install the dependencies of an old Symfony 4.2 project, I found this exception when trying to install the dependencies as usual:

In PluginManager.php line 762:
                                                                               
  symfony/FLEXcontains a Composer plugin which is blocked by your allow-pl  
  ugins config. You may add it to the list if you consider it safe.            
  You can run "composer config --no-plugins allow-plugins.symfony/thanks [tru  
  e|false]" to enable it (true) or disable it explicitly and suppress this ex  
  ception (false)                                                              
  See https://getcomposer.org/allow-plugins    

To fix this exception, I had to allow this plugin under the config key in the composer.json file:

{
    "config": {
        "allow-plugins": {
            "symfony/flex": true
        }
    }
}

After allowing the plugin, the installation of the dependencies with composer install succeded.


Sponsors