Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use remotePhpBinaryPath when run composer #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bopoda
Copy link

@bopoda bopoda commented Apr 18, 2019

On some shared hostings, we have to use the specified path for PHP binary because of just php can be an outdated version.
For example:

-bash-4.1$ which php
/usr/bin/php
-bash-4.1$ php -v
PHP 7.0.21 (cli) (built: Aug 21 2017 17:45:33) ( NTS )
-bash-4.1$ /opt/php71f/bin/php -v 
PHP 7.1.19 (cli) (built: Jul  4 2018 10:51:26) ( NTS )

If composer.json requires php 7.1+, then function doInstallDependencies will fail because of composer check interpeter version.
doInstallDependencies generates the command:

/storage/home/srv115367/admin.dom-nf.ru/composer.phar install --no-dev --prefer-dist --no-interaction --quiet

composer install command is executed without specified php interpeter:

Executing command: (export APP_ENV=prod; cd /storage/home/user/project/releases/20190418164853 && /storage/home/user/project/composer.phar install --no-dev --prefer-dist --no-interaction --quiet)

So composer install will fail in this case with the error like:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - This package requires php ^7.1.3 but your HHVM version does not satisfy that requirement.
  Problem 2
    - Installation request for doctrine/annotations v1.6.0 -> satisfiable by doctrine/annotations[v1.6.0].
    - doctrine/annotations v1.6.0 requires php ^7.1 -> your PHP version (7.0.21) does not satisfy that requirement.

In this PR I suggest running composer with specified remotePhpBinaryPath.

ref #90

@fd6130
Copy link

fd6130 commented Nov 12, 2021

Nice one, love this PR. Going to merge it to my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants