composer scripts use older php version
<p>I host more and more sites on webfaction. Great provider! I ran into some problems though which I think are Linux related. Hope someone can help.</p>

<p>SSH command <code>php -v</code> defaults to an older version of php, So I created an alias in my <code>.bash_profile</code>: </p>

<pre><code>alias composer="php70 $HOME/composer.phar"
alias php="php70"
</code></pre>

<p>When I preform a <code>php -v</code> now it returns PHP 7.0. So far, so good!</p>

<pre><code>PHP 7.0.0 (cli) (built: Dec  4 2015 12:58:58) ( NTS )
</code></pre>

<p>But now when I run a composer install and put a <code>php -v</code> in the scripts -> post-install-cmd list in my <code>composer.json</code> file:</p>

<pre><code>{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": "&gt;=5.5.9",
    "laravel/framework": "5.1.*"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php -v",
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "pre-update-cmd": [
        "php artisan clear-compiled"
    ],
    "post-update-cmd": [
        "php artisan optimize"
    ],
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
}
</code></pre>

<p>}</p>

<p>Now tt returns the old php version again, see this screenshot:</p>

<p><a href="https://i.stack.imgur.com/f5YF1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f5YF1.jpg" alt="screenshot composer install"></a></p>

<p>Maybe this seems completely logic to you guys/girls, but I'm stuck here.</p>