Homestead: Default php version?

Created on 9 Dec 2017  Â·  3Comments  Â·  Source: laravel/homestead

I know you can set the php version on a per site basis, but is there a way to set the default php version for all sites to use so it doesn't use whatever is the most current version as default if you don't specify a version per site?

Most helpful comment

I'd find it very handy, as setting site-specific PHP version doesn't work for apache type (#630).
That way I could at least choose global version.

workaround, assuming you want switch to php 7.0:
1) add required php version to one of the sites and run provision which will install it: vagrant reload --provision
2) to change default CLI, run sudo update-alternatives --config php
3) switch apache modules

sudo a2dismod php7.2
sudo a2enmod php7.0
sudo service apache2 restart

All 3 comments

Not at this time.

--

  • Joe Ferguson
    JoeFerguson.me
    MemphisPHP.org

On Dec 8, 2017, 19:31 -0600, Steve Heinsch notifications@github.com, wrote:

I know you can set the php version on a per site basis, but is there a way to set the default php version for all sites to use so it doesn't use whatever is the most current version as default if you don't specify a version per site?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

I'd find it very handy, as setting site-specific PHP version doesn't work for apache type (#630).
That way I could at least choose global version.

workaround, assuming you want switch to php 7.0:
1) add required php version to one of the sites and run provision which will install it: vagrant reload --provision
2) to change default CLI, run sudo update-alternatives --config php
3) switch apache modules

sudo a2dismod php7.2
sudo a2enmod php7.0
sudo service apache2 restart

This has been resolved by https://github.com/laravel/homestead/issues/892, but still on have to run vagrant reload --provision to recreate sites.

Was this page helpful?
0 / 5 - 0 ratings