php7dev is a Debian 8 Vagrant image which is preconfigured for testing PHP apps and developing extensions across many versions of PHP. See the Changelog.
Download and install Virtualbox
Download and install Vagrant
If you are on Windows, download and install Git
Make sure you are at least at Vagrant version 1.5 or the steps below may not work for you.
If you are on Windows use the Manual Install instructions or use git-bash.
Otherwise for UNIX and UNIX-like users just clone and go. Like this:
$ git clone https://github.com/rlerdorf/php7dev.git
...
$ cd php7dev
...
$ vagrant up
...
$ vagrant ssh
Add this to your hosts file:
192.168.7.7 php7dev
There are also various vagrant plugins that can help you update your dns. See local-domain-resolution.
At this point you should be able to point your browser at:
http://php7dev/
and it should show the PHP7 phpinfo() page.
The box will also fetch an ip via DHCP so it will be on your local network like any other machine. This also means you don't need to use vagrant ssh anymore.
You don't really need the helpers in the Github repo. I doubt they work well on Windows. You can get up and running using just Vagrant.
$ vagrant box add rasmus/php7dev
...
$ vagrant init rasmus/php7dev
...
$ vagrant up
...
$ vagrant ssh
If you have vagrant version < 1.5, you may run into "command was not invoked properly" error with vagrant box add rasmus/php7dev
, then you can run it with the following explicit url:
$ vagrant box add "rasmus/php7dev" https://vagrantcloud.com/rasmus/boxes/php7dev/versions/0.0.7/providers/virtualbox.box
For DHCP add:
config.vm.network "public_network", type: "dhcp"
To your Vagrantfile. For a static IP, add:
config.vm.network "private_network", ip: "192.168.7.7"
Full docs on this is at https://docs.vagrantup.com/v2/networking/private_network.html.
$ vagrant box outdated
Checking if box 'rasmus/php7dev' is up to date...
A newer version of the box 'rasmus/php7dev' is available! You currently
have version '0.0.3'. The latest is version '0.0.4'. Run
`vagrant box update` to update.
$ vagrant box update
...
$ vagrant box list
rasmus/php7dev (virtualbox, 0.0.3)
rasmus/php7dev (virtualbox, 0.0.4)
At this point you have two versions of the box. It won't automatically destroy your current one since you could have added some important data to it. To use this new version, make sure anything you need from your current one is saved elsewhere and do:
$ vagrant destroy
default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
$ vagrant up
...
If virtualbox complains about an unsupported provider, make sure to have a working virtualbox and prefix the command with VAGRANT_DEFAULT_PROVIDER=virtualbox
:
$ VAGRANT_DEFAULT_PROVIDER=virtualbox vagrant up
...