LocalHost PDF
LocalHost PDF
Development
April 26th, 2009 by Jacob Gube |227 Comments |Stumble It!Delicious
In this tutorial, you’ll learn how to install and configure XAMPP for the desktop.
Once that’s out of the way, we’ll install WordPress so that you can have your very
own professional, light-weight PHP and WordPress development environment.
Introduction
To sum it up in one sentence: XAMPP, which stands for Cross-Platform (X)
Apache, MySQL, PHP and Perl, is a popular, free and open source web server
package that you can use to install a web server onto your desktop.
In this tutorial – you’ll see exactly how XAMPP can do splendid things to
your development cycles.
We’re going to use a simple xampple (sorry, I had to get that out of the way,
been thinking about saying that for a long time): we’re going to install XAMPP and
WordPress with some test data to have WordPress right on our desktop.
This tutorial is for Windows Vista, so you’ll have to tweak the steps involved
depending on your operating system. Here’s what you’ll be doing in this tutorial:
Objectives
• Downloading and Installing XAMPP
• Starting up your Apache and MySQL services
• Installing and configuring WordPress locally
• Creating a MySQL database for WordPress
• Creating a MySQL database user for WordPress in phpMyAdmin
• Importing some test data for WordPress using an XML file
This tutorial covers installing XAMPP in Windows Vista, so you’ll have to tweak the
steps a little bit if you’re using a different operating system.
http://www.apachefriends.org/en/xampp.html
2 Choose the package you want: for normal web development, just go with
the Basic Package.
The Basic Package comes with a host of useful applications, libraries, and
extensions such as phpMyAdmin (which we’ll use to set up WordPress later on)
and eAccelerator(a popular PHP caching application to optimize and improve PHP
script performance). For this tutorial, choose the Installer version.
The following figure shows the first dialog box; it asks you to select which
language you want to use.
The next dialog you’ll see is the first page of the XAMPP Setup Wizard.
4 Pick a destination for the installation.
5 Configure your options in the XAMPP Options dialog box. For this tutorial, just
go with the default installation options.
That’s it for the installation, quick and painless wasn’t it? Let’s fire up Apache and
MySQL.
8 Click the Start button beside Apache. If you’re on Windows, you’ll get a
Windows Firewall warning: choose Unblock.
9 If all goes well, you should see the XAMPP Control Panel log updated with
"Apache Started", and "Running" with a green background right beside the
Apache service.
http://localhost
Congratulations, you now have your very own locally hosted (localhost) web
server!
http://localhost/phpmyadmin/
In this tutorial, we’ll call it wordpress_db. You’ll need to remember this value for
a later step when we configure WordPress.
This isn’t necessary if you’re only testing locally, but we’re going to do this right
to promote best practices.
For Password, type in a value, but it’s highly recommended that you use
theGenerate Password button to randomly generate a password for better
security.
Once you hit the Generate Password button, click on Copy button right beside it
to copy it automatically in the Password and Re-type fields.
Important: take a note of the User name and Password you used, we’ll be using
it later on.
For this example, since it’s a local installation – just check all of them. When you
go into production, pare down the privileges!
23 Click the Privilege tab to see all users that have access to your WordPress
database. You should see wordpress_user listed in the Privilege section.
Alright, you’ve just learned how to create a MySQL database user using
phpMyAdmin. Give yourself a pat in the back before moving on!
• Installing WordPress
This guide will get you up and running with the general process that we’ll be
taking. Please take a moment and read it – I promise, it’ll be quick and painless.
If you used the default installation destination, the file path is:
C:\xampp\htdocs
26 Open up the WordPress ZIP file you downloaded. Extract the entire contents in
the htdocs folder.
Fill in the information with your database information. If you followed along and
used the same values as this tutorial, you can use these values:
28 Once you’re done with the configuration file, save it as wp-config.php in the
same folder.
http://localhost/wordpress/wp-admin/install.php
30 If you did everything correctly, you should be greeted by the following screen:
31 Just hit the Install WordPress button, and follow the steps. If this is your
first WordPress installation, read the steps of the installation dialog carefully as
we won’t be covering it here in detail.
If everything went well, you should see the default WordPress home page:
At this stage, you can log into the WordPress administration section:
http://localhost/wordpress/wp-admin
Alternatively, you can continue in the tutorial (because we’re not done yet).
Next, we’re going to import some test data which you should do when you’re
developing WordPress themes to be released to the public.
http://svn.automattic.com/wpcom-themes/test-data.2008-12-22.xml
http://localhost/wordpress/wp-admin
35 In the WordPress admin section, go to Tools > Import (using the sidebar
navigation on version 2.7).
36 In the Import page, click on WordPress.
38 Assign the authors of the post. The XML file created a testing author
named Noel Jackson for you.
If you don't want to assign the test posts to Noel Jackson, use the or map to
existing field and select the author you want. For this tutorial, assign it
to admin.
39 You'll be presented with a log of all the changes made by the import process.
Examine it if you want to see exactly what happened.
40 Check to see if the import went according to plan. Easiest way is to go to the
home page of your WordPress installation (http://localhost/wordpress).
41 In the home page, you'll see that there's now content for your WordPress
installation. This way you can easily check and test your theme for public release.
You're done, you professional PHP/WordPress developer!
Now you can develop WordPress themes and test changes locally on your
computer, just like the pro's, not only speeding up your development cycles, but
also being able to securely test updates to your existing themes.
Summary
In this tutorial, you just learned how easy it is to install XAMPP to the desktop so
that you can have your very own PHP web development testing server. More
specifically, this is what we did together:
• Installed XAMPP
• Started the Apache and MySQL Services
• Created a MySQL database
• Created a MySQL database user
• Installed and configured WordPress
• Imported some test data
Further resources
• Install Wordpress On Your Mac Using MAMP on Free Mac Blog.
• Installing XAMPP on Linux called Install XAMPP for easy, integrated
development.
• Learn more about XAMPP in the apache friends xampp home page.
• Discover phpMyAdmin and how to use it in the phpMyAdmin official site.
Report a bug or provide some feedback, why don't you?
Feel free to provide feedback and ask questions (lots of them!) in the
comments. Mistakes happen - so please let us know if we made a mistake or
you see an error.
Related content
• 30 Excellent WordPress Video Tutorials
• Cheat Sheets for Front-end Web Developers
• 6 Tips to Help You Get the Most Out of Google Docs
• 30 Useful Open Source Apps for Web Designers
• 10 Promising Content Management Systems
• Related categories: Tutorials, Web Development, WordPress