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

cloud4bpm's avatar

How upgrade my Laravel Homestead VM to PHP 7.0?

Hi, I'd like to customize a Remote Server using Homestead VM in PHPStorm but when I install Laravel Homestead PHPStorm add a Remote PHP 5.6 interpreter. How can I do to upgrade to PHP7.0 my Homestead VM?

Thanks.

0 likes
4 replies
wickley's avatar

Running 'vagrant box update' should do it. That will update the Homestead box to the latest version, which is running PHP 7. If you're concerned about losing anything on the current Homestead VM, you shouldn't have any issues keeping that one and just setting up a new, separate Homestead VM from scratch.

cloud4bpm's avatar

Many thanks wickley,

I doesn't work vagrant update or homestead update.

If I add the laravel/homestead-7 and I'm using the .homestead and Homestead directories, how can I do to use one of those machines individualy?

Thanks.

wickley's avatar
wickley
Best Answer
Level 3

There is a section in the Laravel docs on "Per Project Installation" for Homestead that shows one way to do it:

https://laravel.com/docs/5.2/homestead#per-project-installation

I haven't tried that though. Here's another method that will work but requires some manual editing of the Vagrant file. First clone the latest Homestead into a separate folder. Something like this:

git clone https://github.com/laravel/homestead.git Homestead-7

Homestead-7 can be whatever you want it to be, but needs to be different from your current Homestead folder.

Then temporarily rename your current .homestead folder to .homestead-temp or something. After that run the bash init.sh command that will generate a new ~/.homestead directory with a new Homestead.yaml file in it.

Once that's done, rename the newly created .homestead directory to something like .homestead-7 and change the .homestead-temp back to .homestead. Next, you will need to edit the file named "Vagrant" that's located in the new Homestead-7 directory.

In that "Vagrant" file you should only need to edit one line. Look for something like this towards the top:

confDir = $confDir ||= File.expand_path("~/.homestead")

And modify to your new .homestead-7 path or whatever you named it:

confDir = $confDir ||= File.expand_path("~/.homestead-7")

Then run your vagrant up command from the new Homestead-7 directory and it should work from there.

Please or to participate in this conversation.