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

mgarciadelojo's avatar

Back to Homestead with PHP 5.6

Hi guys,

The thing is I am using MongoDB with vaprobash script with Homestead for my development environment, but since last updates Homestead is now using PHP 7, which is not yet supported by MongoDB driver.

I took a look to the Homestead repository commits and didn't find out what commit I should reset to.

Do you have any idea how can I go back and use PHP5.6 again?

Thanks in advance.

0 likes
15 replies
christopher's avatar

log in in your VM and uninstall php7 and then install php 5.6.

Or you could just clone an older version of homestead: https://github.com/laravel/homestead/releases

And then start your homestead box with this version.

You could also use one homestead box per projetct: https://laravel.com/docs/5.2/homestead#per-project-installation

So for all your projects that needs php 5.6 you take an older homestead box.

Note that you dont have to run the init.sh script since you already have one homestead box installed.

devza's avatar

It seems to be not enough to use an older homestead version. Provisioning ends in " default: php5-fpm: unrecognized service". Current vagrant box doesn't support php5.6, so php version must be still downgraded manually on the VM... :-/

devza's avatar

An other solution would be to use an older vagrant box e.g. 0.3.3 - latest version supporting PHP 5.6

vagrant box remove laravel/homestead

vagrant box add laravel/homestead --box-version 0.3.3

4 likes
ricardoon's avatar

Actually using only vagrant box doesn`t help, cuz Vagrantfile on Homestead asks for version 0.4.0, and if you change to 0.3.3 will have some problems. Well searching for a fork of an older version of Homestead.

My team also uses Mongodb, but most at all uses linux.

1 like
bcoughlin's avatar

@ricardoon I'm in this same situation. just started with Laravel/Homestead and this is blocking me from exploring further!

bcoughlin's avatar

@bashy that was the direction I was headed but then I think I'd have to configure NGINX myself. I like the lazy Homestead.yaml way. Maybe that's the best way to go, but I was looking for shortcuts.

bashy's avatar

@bcoughlin Vaprobash actually has the same commands (not as easy as Homestead.yaml) via the serve command within the server. You could also make it pretty easy to automate it by some small scripts to copy files to nginx.

knox's avatar

I ran into the same issue, our work box requires using the mongo driver but personal projects I wanted to try out PHP7. Not totally sure it's the proper way to do it but I forked the homstead repo and changed the scripts to setup a new php56 box based off the previous Homestead.yaml file and a new directory Homestead56 so you can choose to vagrant up Homestead or Homestead56. Works well for me/our team.

Here's the link if anyone is interested: https://github.com/gjrdiesel/homestead56

3 likes
ian_h's avatar
ian_h
Best Answer
Level 20

I stopped using Homestead as I wanted more flexibility (I use VMware rather than VirtualBox for example). Give https://puphpet.com/ a try.. you can customise your box to whatever you want... you can easily run multiple VMs (so PHP5.6 and PHP7 depending on your needs).. and everything is defined in the config.yaml file (which you can drag-drop back into the site to make any tweaks in the future... easy for adding new databases or virtual hosts if you don't want to edit the file manually).

It's a great project IMO :)

Cheers..

Ian

2 likes
bristoldigital's avatar

There is no solution. The above answers are alternative implementations.

Please or to participate in this conversation.