bolt / project

🚀 Repo to `composer create project` a Bolt 5 project.
MIT License
39 stars 38 forks source link

Use `@php` in Composer scripts to support actually used PHP binary #77

Closed emodric closed 3 years ago

emodric commented 3 years ago

Hi!

When having multiple PHP versions installed, and using the following to install Bolt:

php7.4 ~/bin/composer create-project bolt/project

the install fails at the end with:

> php bin/console extensions:configure
PHP Parse error:  syntax error, unexpected token "match" in vendor/willdurand/negotiation/src/Negotiation/Negotiator.php on line 41

This is due to Composer using the php binary, which in my case is PHP 8.

Using @php in Composer scripts config make sure Composer reuses the same PHP binary that was used to run Composer in the first place.

emodric commented 3 years ago

Thanks @bobdenotter !

I suppose this needs to propagate to master branch too, since the structure of site changed there.