Using MultiPHP, I'm setting some accounts to use PHP 7.1. This is working fine, and also works on the command line for these accounts, if I type php -v I get:
All good.
But if I run composer install it doesn't seem to pick up the specified version of PHP and defaults to 5.6, which in turn causes it to fail, complaining that my project requires PHP 7.1.
How can I get composer to pick up the correct PHP version?
---
One workaround I have found is to use:
But including the PHP version in the command isn't ideal for various reasons, I'd prefer if could detect it automatically like it does when running php.
Code:
ea-php-cli Copyright 2017 cPanel, Inc.
PHP 7.1.20 (cli) (built: Jul 30 2018 09:39:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
But if I run composer install it doesn't seem to pick up the specified version of PHP and defaults to 5.6, which in turn causes it to fail, complaining that my project requires PHP 7.1.
How can I get composer to pick up the correct PHP version?
---
One workaround I have found is to use:
Code:
php -ea_php 71 /opt/cpanel/composer/bin/composer install