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

Jafo232a's avatar

Homestead with specific versions of PHP & MySQL

We will be putting a new team on a project of ours that currently runs on PHP 5.6 and mysql 5.6. I am putting together the homestead box and haven't found a good way to set these versions IN THE Homestead.yaml file. I know I can go in there manually and put these packages in, but I need to be able to distribute only the Homestead.yaml file and not a list of instructions on how to downgrade everything. Here is what I have tried:

ip: "192.168.10.10"
memory: 8096
cpus: 2
provider: virtualbox
name: project_a
ssl: true

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/virtualmachines/projecta
      to: /vagrant/projecta


sites:
    - map: projecta.com
      to: /vagrant/projecta/public
      type: apache
      php: "5.6"

databases:
    - projecta

features:
    - mariadb: false
    - ohmyzsh: false
    - webdriver: false
    - mysql8: false
    - php7: false

But it still installs MYSQL 8 and PHP 7.

Is there any way of doing this without manually installing these package requirements or downgrading vagrant (our developers have many vagrant projects)?

0 likes
3 replies
petrit's avatar

You can change php version from virtual machine. Connect to vagrant

vagrant ssh

if you want to change php to version 7.3 than execute this command

php73

Don't forget to run "vagrant provision"

1 like
Jafo232a's avatar

I don't want PHP73... I want PHP 5.6 and mysql 5.6..

petrit's avatar

Than, execute this

php56

and its done

Please or to participate in this conversation.