Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to fix SSH command running in wrong container?


Hi all,

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.

My bitbucket-pipelines.yml:

image: php:7.4-fpm
...
- pipe: atlassian/ssh-run:0.2.5
variables: SSH_USER: $MY_USER
SERVER: $MY_SERVER
MODE: 'script'
COMMAND: './bitbucket-deploy.sh'

bitbucket-deploy.sh

#!/bin/bash
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.

Any tips?


Thanks

1 answer

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

or:

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
/usr/bin/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
...

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Announcing the waitlist for Jira Work Management

Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...

644 views 10 16
Read article

Community Events

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

Events near you