phpsymfonysymfony4symfony-console

How to configure symfony check:requirements?


I am using Symfony for an application. This application needs particulars PHP extensions to work, such as PHP GD, which are not listed in the base Symfony requirements.

I would like to know if it's possible to kind of edit the base list of requirements to add those extensions for my application to have them listed under the symfony check:requirements console output.


Solution

  • This requirements will NOT be tested when you launch symfony check:requirements, because this command doesn't depend of your application, it only checks the capacity to use symfony on the server.

    This command will always return the same result, even if you launch it in a directory where there is no composer.yaml file.

    But, you can add the needed extension by updating the composer.json file:

    
        ...
        "require": {
            "php": "^7.2",
            ...
            "ext-gd": "*",
            "ext-json": "*",
            ...
            "foo/bar-bundle": "^1.3",
            ...
        }
    

    So, if the GD extension isn't installed on your server, installation of your application will not start.