-
Notifications
You must be signed in to change notification settings - Fork 3
Development Environment
The first step in any new project is creating a reliable space for you to work. By using a virtual machine, we can work in an environment that is very-much like a real web server. In fact, it is a real web server in every sense of the word, except that it is not available to the public internet. Hence calling it a "local" environment.
- Download and install VirtualBox https://www.virtualbox.org/wiki/Downloads (I think we're safe to use the 5.x version)
- Download and install Vagrant http://www.vagrantup.com/downloads.html
- Download VVV 1.2.0 and unzip it to the folder where it will live. Rename the folder VVV (instead of VVV-1.2.0). https://github.com/Varying-Vagrant-Vagrants/VVV/tree/1.2.0
- Download and install SourceTree https://www.sourcetreeapp.com/ This is a Git GUI that I like a lot.
- Open a command prompt and go to the directory where you extracted VVV (see OS specific instructions below).
- Type
vagrant plugin install vagrant-hostsupdater
, this will install a vagrant plugin that saves us a little work. - Then type
vagrant up
, and go get some coffee, or have dinner or something... it can take 30 mins or so to install the virtual machine. (could be faster, watch it work if you want) - Once it is done, you should be able to open a browser and go to http://local.wordpress.dev to see your new local development version of WordPress
- You can login at: http://local.wordpress.dev/wp-login.php with
admin
andpassword
-
Windows Command Prompt - Hold down the Windows key and press R. This opens the "Run" dialog box. Type in
cmd
and press Enter. You will likely be in your user account's home folder. Example:C:\Users\Jonathan>
. You can change directories with thecd
command. Assuming you put the VVV folder in your Documents, you can browse to that folder by running the commandcd Documents\VVV
-
Mac Terminal - Open your Application named Terminal. You will likely be in your user account's home folder. Like Windows, you can change folders by using the
cd
command. But unlike Windows, you will use forward slashes/
instead of back slashes\
. Assuming you extracted VVV to your Documents folder, you can browse to that folder by running the commandcd Documents/VVV
Vagrant is a tool that helps provision (create/launch/make) development environments in a standardized manner. Using this, we can all easily have the exact same setup with very little effort.
These virtual machines take up a portion of your computer's CPU and RAM, so you probably don't want to run them all the time. You just turn it on when you want to work, and turn it off when you're done.
Common/Useful Commands:
-
vagrant up
- Start the virtual machine -
vagrant halt
- Stop the virtual machine -
vagrant reload
- Reboot the virtual machine -
vagrant destroy
- Delete the virtual machine
General usage reasons:
-
vagrant up
- You are ready to start working on a project. In your command prompt (Terminal on Macs), browse to the directory where you extracted VVV and runvagrant up
. -
vagrant halt
- You are done working for the day, or need to restart your computer for some reason. In your command prompt, browse to the directory where you extracted VVV and runvagrant halt
. -
vagrant reload
- Something is acting strange in your development environment, or you can't access your local sites. In your command prompt, browse to the directory where you extracted VVV and runvagrant reload
. -
vagrant destroy
- We'll probably never use this. If you need to completely start over with your development environment because something has gone terribly wrong.