WordPress on your local machine
You’re a Web developer and you need some sort of staging for your WordPress-powered site. You don’t like developing your site directly off of your production server because (1) Internet connectivity isn’t always reliable or fast, (2) you prefer to keep your site under wraps until it’s ready for the public eye, (3) some other reason I haven’t thougth of yet.
Although WordPress will run on Windows/IIS, chances are, your Web hosting will be on a Linux box running Apache. So, the best way to recreate that environment for local development on your desktop or notebook is to install a local Web server package. What I use now to develop new WordPress sites is WampServer 2.
WampServer emulates the Apache Web server with PHP and MySQL installed. All the necessary modules that WordPress needs (e.g., mod rewrite) are present, and it takes just a few minutes to install and run. Do you feel a how-to coming on…?
OK, let’s get started. I’m assuming here that you use Windows. If not, I’m sure you’ll find something similar for your Mac.
Installing WampServer
Download WampServer 2 from the link above, and install it on your local machine. It will do everything in the background for you, including installing PHP and MySQL. What’s more, you’ll even have access to your own phpMyAdmin and, if you prefer the classic approach, a MySQL console.
After installation and initial launch, you’ll get a WampServer icon on your system tray, looking like half a speedometer. Click on it to bring up the menu. If it’s not online, click on Put Online. If you type “localhost” on your browser URL bar, you will see something like this page:
To install WordPress, follow the steps below. But before that, don’t forget to activate Apache’s rewrite module — without this, you won’t be able to make use of WordPress permalinks. Left-click on the WampServer icon on the system tray, and go to Apache » Apache modules. You’ll then get a long list of modules arranged alphabetically. Look for rewrite_module and check it.
Installing WordPress
OK, now for WordPress. Extract the WordPress .zip file onto c:\ — this will create c:\wordpress. You may change the name of the folder to anything that you fancy, but for our purposes, let’s keep it as is.
Bring up the WampServer menu, and create an alias directory: Apache » Alias directories » + Add an alias. This will cause a command-prompt window to open with the following screen:
Enter your alias. For example, 'test' would create an alias for the url http://localhost/test/ :_
Let’s use blog as our alias. The next screen will show this:
Enter the destination of your alias. For example, 'c:/test/' would make http://localhost/blog/ point to c:/test/ :_
Enter c:/wordpress/, the directory we created earlier. When successful, a message saying “Alias created. Please Enter to exit…” will appear. Now you’ve created a website account with the URL, http://localhost/blog/.
Next, let’s create the database and database user in MySQL. Take a look at this page from the WordPress.org codex for step-by-step instructions on creating databases using phpMyAdmin.
Armed with your database name, username and password, you can now go ahead and perform the famous WordPress 5-minute install. Load http://localhost/blog/ on your browser, and you’ll see that WordPress says it will create the configuration file for you. Go to the next screen and enter the database credentials, and voilá! You now have a WordPress site running on your desktop or notebook!
WP2.8’s theme installation / uploading should work, as well as the similar interface for plugins. Everything should look and feel as if you had a live WordPress install, except that this one’s probably much faster and responsive.
To the bat cave!
After you’ve done your design work, template-tweaking and all your customizations, after publishing your new site’s static pages (“About”, “Contact Form”, etc.), and probably a few blog posts as well, you can now deploy your WordPress site onto your production server.
Backup your database by following this excellent procedure written by Automattic.
Use cPanel or FTP to transfer the WordPress folders and files (wp-admin, wp-includes, wp-content & all the .php and other files in the main directory) to your website account on your production server. No need to reinstall WordPress. Simply transfer the entire local site to the live Web.
If you’ve installed plugins (e.g., WP-DBManager) that have settings asking for server paths, make sure to change them to the proper values as soon as you finish transferring your site. Take a look at the screenshot of WP-DBManager, which I installed in my own WampServer-driven local WordPress site. As you will see, the server paths indicated are those of my local machine’s. After deploying this site to the Web, I should change these values to my production server’s paths. (Good thing this plugin has auto-detect buttons!)
Now for your database. Presumably, you already have a .sql file on your local hard drive, generated by the backup procedure above.
On your production server, bring up phpMyAdmin and create a database with the same name as the one you created earlier on your local machine. Specify the same username and password as well. (Otherwise, if you use different database login credentials, change those values in your wp-config.php file.) Now, choose that new database and select Import from one of the horizontal tabs, and follow the instructions.
And that’s it! Your new WordPress-powered site’s live!
Stuff to do when upgrading to WP2.5 | Upgrading multiple WordPress installs | WordPress plugins I use | WordPress 2.6 released! | WordPress 2.8-beta1
































learned the basics especially using the alias thing in pointing the sites, which i was tied up earlier, now i can start testing sites that are wordpress powered.
accomplished!
Hey, you have to teach me this soon! Anyhow hope to hear to hear from you and have you over here in Manila soon.