On live server I use differents drush and php versions for drupal 8.4 and 7. I install drush 9 to ~/drush9 directory with composer require drush/drush:9.*
command.
On dev server and drupal 8.4 I use site.alias.yml file for drush 9:
live: host: hostingexample.com user: user root: /home/user/example.com/public_html/ uri: http://example.com/ paths: drush-script: '/opt/php70/bin/php /home/user/drush9/vendor/bin/drush'
And for command drush @site.live ev 'print PHP_VERSION'
have an error: bash: /opt/php70/bin/php /home/user/drush9/vendor/bin/drush: No such file or directory
If I add
alias php=/opt/php70/bin/php alias drush9=~/drush9/vendor/bin/drush
in hosting .bash_profile and change drush-script: '/home/user/drush9/vendor/bin/drush'
in site.alias.yml. And have an error PHP Parse error: syntax error, unexpected '[' in /home/user/drush9/vendor/drush/drush/src/Config/Environment.php on line 98
. Because on hosting default php version is 5.3.
How to use another php version for hosting and config it for drush 9 aliases?