Make sure PHP executable is being resolved by composer #1701
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are situations where php executable is not in path or is not called
php
in those casescomposer update
andcomposer install
will break or might use php version which might not be the same as the one running the composer process.One of the examples can be that on your system you have at least two versions of PHP. One available as
php
the other asphp.7.1
and so on.If you were to run
php7.1 /path/to/composer.phar install
in the project directory, the composer will be executed byphp7.1
but the artisan scripts will be run underphp
executable and most likely will fail.Defining scripts in
composer.json
which referencephp
executable using@php
token avoids this issue./ref https://getcomposer.org/doc/articles/scripts.md#executing-php-scripts
/ref composer/composer@b000061
/ref https://github.com/symfony/process/blob/master/PhpExecutableFinder.php
Changes in this pull request:
php artisan
calls with@php artisan
to ensure correct PHP executable resolution@JC5