For the deployment of a site under Symfony 5, at Gandi.net,
I try to make the deployment by git stable, since Gandi has the dependency manager that we like so much: Composer
The requirements for this deployment are as follows:
* Php server
* project in a directory “../site-url.org/htdocs”
I moved my files entirely to a htdocs/ folder at the root of my repository/project.
Then I just need to execute an order so that my repo is retrieved from my server and the dependencies are downloaded there.
During the deployment I encountered these messages.. :
-----> Starting new deployment (*xxxxxx*.org - master) -----> Fetching application code -----> Building new application ERROR: composer.json and composer.lock files should be placed outside the htdocs directory (../htdocs/) Dependencies could not be installed. Exiting... Please refer to the documentation: [fr] https://docs.gandi.net/fr/simple_hosting/langages/php.html#gestion-des-dependances [en] https://docs.gandi.net/en/simple_hosting/instance_languages/php.html#dependency-management -----> Building new application failed -----> Aborting deployment code here
So I moved, composer.json and composer.lock (only) and retried the operation, which as I expected gave the same result.
I therefore conclude that I need to review the architecture of my Symfony project to separate the dependency files and the application files. (I obviously read the famous link several times in the error message This one) After many tests, I am still in the same observation with Symfony, as soon as we touch the structure, it is complex.
Source: Symfony Questions