We know that a number of you who follow The 8BIT Network are fans of WordPress and build a number of your sites on the platform.
Though it’s relatively easy to get started setting up WordPress, installing themes (or writing your own), and customizing the installation, setting up a local development environment can go along way in saving you a lot of time as you work on multiple projects.
Here’s how you can setup an environment on your local machine.
1. Getting Started
This post assumes that you’ve read The Beginner’s Guide To Setting Up a Development Environment. Specifically, we’re assuming that you’ve read:
- Using Dropox To Manage Project Files
- Installing a Web Server, Database, PHP, and Related Tools
- Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment
As such, this guide also assumes that you have a Project directory located in your Dropbox and that you’ve got a database frontend (such as SQLBuddy) installed, too.
2. Setup The Database
Before installing WordPress, we need to setup the database that will be used by the application’s installation. Assuming that you’ve got Apache and MySQL installed, go ahead and start both services:
Next, open your web browser and launch your database frontend:
Login to the dashboard:
From there, create a database. Name it whatever you’d like (but something meaningful such as wpsandbox always helps).
Next, you can close the database frontend. You’re done.
3. Install WordPress
Now it’s time to install WordPress. Grab a copy from WordPress.org, download the archive, and remember where you save it.
In your Dropbox Project directory, create another directory. This is where we’ll install WordPress so name it something meaningful. Giving it a short name is helpful, too as you’ll be typing this a lot during the course of development.
Next, extract WordPress to the directory we just created. Once done, your working directory should look like this:
4. Configure WordPress
At this point, you’re now ready to configure WordPress so launch your browser and navigate to the directory in which you’ve just installed the application.
If you’ve been following this tutorial and the related guide, then you should be able to navigate to http://localhost/wp (or whatever directory you’ve named it). If all has gone well, you should be presented with the WordPress configuration screen:
Go ahead and create it.
On the next screen, we’ll need to fill out the information. Recall the name of the database you created in step one. Since this is a local development environment, the database username is likely root and there is no password; however, your installation may vary.
Click submit and you should bedone.
4. Development
To be clear, there are several advantages to this type of installation:
- Keeping it in your Dropbox gives you a portable installation of WordPress that you can use for development on a number of machines
- All of your files will be backed up along with 30 days of version history
- You now have a sandbox in whcih you can install themes and plugins, develop your own WordPress-based solutions, and test them out prior to deploying them.
In a future series, we plan to take a look at developing WordPress plugins and that series will be based largely on this type of installation so if you’re new to all of this, this is a great place to start.
Craig Allen says
Good stuff. Looking forward to the series about plugins!
Tom McFarlin says
Should be starting soon 🙂
Ben says
Dude! You are a machine! Me and @andydarnell talked about this a while back. This is great. Will you do a post on publishing it to a live database after dev?
Tom McFarlin says
Yeah, we can probably swing that.