Skip to content

Instantly share code, notes, and snippets.

@dleatherman
Created July 27, 2017 15:18
Show Gist options
  • Save dleatherman/c5a4aa1da486727008ba9db1116d2227 to your computer and use it in GitHub Desktop.
Save dleatherman/c5a4aa1da486727008ba9db1116d2227 to your computer and use it in GitHub Desktop.
Getting set up with a development Wordpress environment all from the command line

RTFM

Local Development

There are a few prerequisites for local development.

  1. Git & Github Account

Setting up a Wordpress instance with the Campfire theme

  1. Run git clone repo.git
  • Run cd repo
  • Run wp core download

Setting up your mysql user and database

  1. Make sure you have MySql installed by running which mysql
  • Open mysql mysql -uroot -p and enter root password (default: root)
  • Run CREATE DATABASE dbname;
  • Run CREATE USER 'username'@'%' IDENTIFIED BY 'userpass';
  • Run GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
  • Run exit;

Setting up your wp-config and database

  1. Run wp config create --dbname=dbname --dbuser=username --dbpass=userpass
  • Depending on your mysql setup you may need to change the DB_HOST to 127.0.0.1
  • Ask for a copy of the db.sql file and place it in a db directory
    • If the file's extension is .gz you'll need to run gzip -d db/db.sql.gz
  • Run wp db import db/db.sql

Starting your server

  • Run wp server
  • Navigate to http://localhost:8080/wp-admin/
  • Navigate to Elementor Settings and Regenerate Styles
  • Celebrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment