deployer
deployer copied to clipboard
deploy:vendors task does not runs `composer install` (runs instead `php composer install`)
- Deployer version: 7.0.0 (but 7.0.0-rc.4 works)
- Deployment OS: Ubuntu 22.04 / Ubuntu 20.04 on Plesk VPS
When excecuting deploy:vendors task, version 7.0.0 runs command cd ~/httpdocs/releases/22 && /var/www/vhosts/my-host/.phpenv/shims/php /var/www/vhosts/my-host/.phpenv/shims/composer install --verbose --prefer-dist --no-progress --no-interaction --no -dev --optimize-autoloader 2>&1 which does not run composer install, instead this command prints:
set -e
[ -n "$PHPENV_DEBUG" ] && set -x
program="${0##*/}"
if [ "$program" = "php" ]; then
for arg; do
case "$arg" in
-e* | -- ) break ;;
*/* )
if [ -f "$arg" ]; then
export PHPENV_DIR="${arg%/*}"
break
fi
;;
esac
done
fi
export PHPENV_ROOT="/var/www/vhosts/my-host/.phpenv"
exec "/opt/plesk/phpenv/libexec/phpenv" exec "$program" "$@"
The only difference I found in recipe/deployer/vendors.php file between version 7.0.0 and version 7.0.0-rc.4 is:
Deployer v7.0.0-rc.4 recipe/deployer/vendors.php, lines 16-18
if (commandExist('composer')) {
return which('composer');
}
Deployer v7.0.0 recipe/deployer/vendors.php, lines 16-18
if (commandExist('composer')) {
return '{{bin/php}} ' . which('composer');
}
This second version causes the error, I suppose it needs to be revised in some circumstances (which I ignore 😅).
Looks for me .phpenv does not use a official composer phar instead it wraps composer with some custom script 🤔. Which I personally would see as problamatic. Or can you identify if /var/www/vhosts/my-host/.phpenv/shims/composer is a phar or a custom script?
Normally composer file look something like this:
Or something wrong with /var/www/vhosts/my-host/.phpenv/shims/php, what does /var/www/vhosts/my-host/.phpenv/shims/php --version return on your server?
In fact composer is a custom script:

/var/www/vhosts/my-host/.phpenv/shims/php --version works fine.
Not sure what we should do about this one. Closing for cleaning purposes.