Deploying a PHP app, when running 'composer install' in the server it fails:
This package requires php ^7.2.5 but your PHP version (5.6.22) does not satisfy that requirement.
- pipe: atlassian/ssh-run:0.2.5
variables: SSH_USER: $MY_USER
composer install -o
The server has php 7.4 installed. If I run composer install manually, it works.
Somehow the command is running in a wrong place and I need to execute it in the remote server.
I see two options here:
1.) Tell composer to ignore the PHP version and the extensions:
composer install -o --ignore-platform-reqs
As this is unattended, also consider to disable interactivity and all scripts and plugins:
composer install --no-interaction --no-scripts --no-plugins -o --ignore-platform-reqs
2.) Find the path to the correct PHP version on that system an execute composer with it:
/usr/bin/php7.4 -f "$(which composer)" -- install --no-interaction --no-scripts --no-plugins -o
The /usr/bin/php7.4 part is just exemplary, replace it with the correct one on that system. If I read it right you're able to login there and have the correct version:
$ which php
$ php --version
PHP 7.2.30-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Apr 19 2020 07:50:50) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Hi Atlassian Community, My name is Avni Barman, and I am a Product Manager on the Confluence Cloud team. Based on feedback from you, we are giving admins more power to create templates that a...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events