Examples will be shown using MacOS and Vagrant virtual machine (https://www.vagrantup.com/). Windows developers can aslo refer to https://www.sitepoint.com/getting-started-vagrant-windows/ on getting Vagrant up and running.
Once Vagrant is installed, a Scotch Box virtual machine will be used.
Step by Step (5 minute install)
- Move to your local directory where you would like your local development. For me it is ~/Sites
git clone https://github.com/scotch-io/scotch-box SITENAME
(this installs the VM into the directory SITENAME)cd SITENAME
(go into directory)vagrant up
(start Vagrant)vagrant ssh
(log into the virtual machine that is now running)cd /var/www/public
(move to the web directory where Wordpress will be installed)wp core download --version="4.8.1"
(this downloads Wordpress version 4.8.1)wp core config --dbname=scotchbox --dbuser=root --dbpass=root
(this configures your Wordpress for the virtual machine)- edit your /etc/hosts file and add the line 192.168.33.10 SITENAME.dev (this allows your browser to find the Wordpress site you just installed)
- edit the wp-config.php and add the lines (at the end)
- define('WP_CACHE', false);
- define('ENABLE_CACHE', false);
wp core install --url=SITENAME.dev --title=SITENAME --admin_user=admin --admin_email="[email protected]"
(installs Wordpress)wp cli update
(updates Wordpress)wp plugin update --all
(updates plugins)- go to http://SITENAME.dev