When it comes to WordPress development on your local machine, a very quick and easy way to get started would be to use a Vagrant box, particularly a Homestead box. Homestead is a Laravel ready-made vagrant box that enables the user to very quickly get the Vagrant machine up and going with everything needed to run a Laravel. I use Laravel everyday, but I also develop sites in WordPress, so it makes sense that I would want to run WordPress on my Homestead box.
Here’s how you can add a WordPress install to an existing Homestead box. If you run into any problems, leave me a comment and I’ll do my best to help. If you need to get Homestead running, try following the Laravel Homestead documentation to get that going.
First off, you’ll need to start your homestead box and SSH into it. You can use putty or you command line. Once you’re in the vagrant box, cd into the /home/www folder.
cd /home/www wget http://wordpress.org/latest.zip unzip latest.zip
mv wordpress yourdomain cd /etc/nginx/sites-available
cp existing.conf yourdomain.conf
CTRL + X and follow prompts to save the file. cd ../sites-enabled ln -s ../sites-available/yourdomain.conf . service nginx restart
mysql -uhomestead -psecret create database yourdomain; quit;
cd /home/www/yourdomain cp wp-config-sample.php wp-config.php nano wp-config.php
CTRL + X to save the file. Follow the prompts to complete the save.