In the previous article, we used XAMPP to install Apache, MySQL, and PHP in order to setup a home development environment.
Since many in the 8BIT Community are big fans of WordPress, we’re going to take a look at how we can go about set it up on for local development.
This ultimately helps facilitate faster development and prevents bugs from being displayed on your public website. You only publish when you’re ready.
Speaking of ready, let’s get started.
Installing WordPress
Obviously, the first thing you’re going to want to do is download a copy of WordPress. The most recent build of the application can always be retrieved from WordPress.org so head over, grab the zip file, and save it to your hard drive.
Once done, unzip the files into your htdocs folder. Remember: this is the directory out of which files are served. It doesn’t matter whether or not the files exist in the root of the htdocs folder or in a folder called “wordpress” – go with whatever works for you.
Setting Up The Database
Before we can actually get to development, we need to setup a database in which WordPress can store its stuff. Assuming that you’re using SQLBuddy as mentioned in the last article, load it up in your web browser.
Remember that it will prompt you to login. Because we’re running this on our local machine, the username is root and there is no password. Obviously, this isn’t the case for publicly available systems as it presents the most epic security concern. The luxury of doing local development is that we don’t really have to worry about it, so go ahead and login.
From here, go ahead and create a database for WordPress. Do this by filling out the “Create Database” form on the SQLBuddy homepage. Give it whatever name you like.
Okay. Database is ready. All done here.
Getting To Work
Now, point your browser to wherever you installed WordPress. Assuming that you unzipped the files to their own “wordpress” folder, navigate to http://localhost/wordpress. You should be presented with the WordPress configuration screen.
Follow the usual steps – remember to specify the name of the database you just created – and copy (or write down) the password. You’ll need it for the initial login. Next, login to the system using the credentials you just copied. Feel free to update any of your profile information.
Alright, at this point you’ve got a fully functional WordPress installation setup on your box. It functions the exact same way any public installation should require, but you can totally mess it up and no one will ever know. Cool, right?
This means that you’ve got full access to install plug-ins, themes, custom files, tweaks, etc to get the blog functioning and looking exactly as you want.
Taking it Live
This next part assumes that you’re comfortable using an FTP client (I like FileZilla), logging into your server, and uploading files. Whenever you’re planning to release whatever you’ve built on your local machine to the world, go ahead and connect to your webserver.
From here, you should have a near one-to-one mapping of your local WordPress installation and your public WordPress installation. This means that you can freely transfer any files from, say, your themes directory to your public themes directory and have them ready to roll whenever you activate the theme.
Installed any plug-ins locally? Simply upload the plugins directory to the same location on your website. Same goes for themes. You’ll be able to activate them from within the WordPress administration area.
If you end up experiencing problems, make sure that you don’t have any hardcoded links pointing to any localhost-based URLs and that you’ve got the same version of WordPress running on both your desktop and your public server.
Okay, enough of this. Go get to building something.
Stephen Bateman says
1. Can you use Fantastico or other such shortcuts on a home server?
2. I should really start doing this. right now I just publish to sandboxes on the internet, but it’d be a bit quicker to do it locally. Thanks for the guide Tom.
tomsfoolery says
Anything that can be run on a normal webserver should be able to run on XAMPP, so it’s totally possible configure Fantastico on something like this. You’ll probably just have to make sure the paths are setup properly.
Re:sandboxes, exactly. It’s nice to be able to work on stuff locally, launch it, and have all the tweaking and other work done.
Coach Spoon says
Great set of posts…I plan to use this as a resource in a class I teach on Web Design. Thanks for the big help.
Tom says
Thanks for the comment – really appreciate it. Glad I could help!