Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

laden's avatar
Level 1

Homestead with php 7.1 ? please help

Any1 know what version to use of vagrant and homestead to get php 7.1 as default?

I cant do composer install on projects that dont support php7.2 as long as I have php 7.2 set as default it seems :(

0 likes
2 replies
Cronix's avatar

As far as I know, you can't set a "default" for the whole system. It uses the most current version as "default". You can, however, tell each site which version of php to use for it.

sites:
    - map: homestead.test
      to: /home/vagrant/code/Laravel/public
      php: "7.1"

https://laravel.com/docs/5.6/homestead#multiple-php-versions

You can also specify which version of php to use when using the cli, so try running composer with the version you need (same docs I linked to)

laden's avatar
Level 1

If you go back to vagrant v4.0.0 and homestead 6.6.0 you get php 7.1 as default atleast. with vagrant v5.2.0 you get php7.2, havent tested v.5.1.0 yet.

Can I tell composer to use php7.1 when doing a composer install? I tried the below setting in Homestead.yaml, but composer install still stops because because of a no support for php 7.2 error. And I have php7.1 and all the needed packages installed

    - map: magento.test
      to: /home/vagrant/code/magento/pub
      php: "7.1"

Please or to participate in this conversation.