Search code examples
phplaravelvagrantlaravel-queue

Force Laravel queue to run different PHP version (Vagrant)


My Vagrant box currently has the PHP version 7.3.1, however my project needs to be run on 7.2. I have altered the Homestead.yaml file to use 7.2 like so:

sites:
    -
        map: rcoa.local
        to: /home/vagrant/Code/rcoa/application/public
        php: "7.2"

And run: vagrant reload --provision

However, I am still getting PHP 7.3 related errors when running my queue. Is there any way of forcing php artisan queue:work to use a specific PHP version?

Thanks.


Solution

  • Try this command inside your VM:

    sudo update-alternatives --config php
    

    than select PHP version you want to use: enter image description here Source