I am using deployer to package a symfony application on the server. During the deploy I also need to run composer install to run important commands like bin/console. Only then the deployment can be completed. Unfortunately the deployment fails and interrupts at 'composer install' with the error message:
[Deployer\Exception\RuntimeException (127)]
The command "cd /usr/home/xxx/public_html/sw6-staging/releases/1.1 && composer install" failed.
Exit Code: 127 (Command not found)
================
bash: line 1: composer: command not found
This is the task in the deploy.php looks:
task('sw:deploy', function(){
run('cd {{release_path}} && composer install');
});
task('deploy', [
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'sw:deploy',
])->desc('Deploy your project');
But if I run the command 'composer install' directly on the server via CLI it runs through. What is the problem and how can I solve it?
Deployer version 6.8. PHP version 7.2
Thanks a lot