Site aliases: Use a different PHP path on remote The Problem:

For reasons I'm not gonna get into, the path to my php executable is NOT /usr/bin/php but is instead something else (let's say it's /local/path/to/php).

My staging and production servers do use /usr/bin/php, however; Moreover, the non-standard php path doesn't exist on those servers.

The problem is that whenever I run a Drush command for a remote site, I get an error:

$ drush @mysite.remote status
bash: /local/path/to/php: No such file or directory


Since /local/path/to/php definitely exists on my local machine (or else my local sites wouldn't work and drush would fail) I can only assume that error is coming from the remote server.

I know I can pass --php=/usr/bin/php to Drush, but there are some less Drupal-savvy devs on my team, so I want to get it configured for them so they don't have to think about it.

I also know about the $DRUSH_PHP environment variable, but setting that to /usr/bin/php breaks drush on my dev machine entirely, so that's not an option either.  It just straight-up breaks Drush.

The Question:

Is there a way to configure my remote aliases to use a specific path to PHP that is different to my local machine's PHP path?  (And why is a remote server trying to use a local path to PHP in the first place?)

If not, what workarounds are there? (I'm hoping I won't have to create a symlink at /non/standard/php to /usr/bin/php on my servers, because that feels fragile and hack-ish, but if there are no alternatives, it'll have to do.)



Drush 7.4.0
From example.aliases.drushrc.php: 


  Although most aliases will contain only a few options, a number
  of settings that are commonly used appear below:


...


  'php': path to custom php interpreter. Windows support limited to Cygwin.


So try somtehing like:

$aliases['example'] = array(
  'uri' =&gt; 'example.com',
  'root' =&gt; '/var/www/example.com',
  'remote-host' =&gt; 'www.example.com',
  'remote-user' =&gt; 'user',
  'php' =&gt; '/path/to/php/on/the/server'
);


You could try that. If this doesn't work I would suggest to update your drush version (locally and on the server) and try again, before doing any strange symlinking on the server.