简体   繁体   中英

Homestead and Local php version for per project vagrant installation

I've trying to run a per-project vagrant installation for a laravel 8.2 project I just clonned from the repo, personally I dont like laravel 8, but w/e so my local enviroment is set to run laravel 7 projects, and my local php version is 7.2.22 but for this project, it tells me that composer requires at least php 7.3 version (on my local machine).

The main reason to use vagrant/homestead is that you dont have to affect or change any on your local machine in the first place, right? so if I dont want to upgrade to 7.3 it makes no sense it doesnt allow me to create de virtual machine bc first I have to upgrade it when the point is that I can modify as much I want inside the Virtual machine and not my local...

Any suggestions?

At the end, I was not able to find a way to run vagrant without modifying my local machine, so had to update the php version on my local machine

if you are using Homestead, you can refer the laravel documentation https://laravel.com/docs/8.x/homestead#php-versions

you can always use specific php version per project

Edit your Homestead.yaml

Example:

sites:
    - map: sample1.app
      to: /home/vagrant/code/sample1/public
      php: "7.2"

    - map: sample1.app
      to: /home/vagrant/code/sample1/public
      php: "7.24"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM