Académique Documents
Professionnel Documents
Culture Documents
Once thats out of the way, well 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.
XAMPP allows you to develop PHP and Perl-based server-side scripting applications without the need for a remote web server, offering you the opportunity to work faster, develop stuff more securely, and work on your apps without an internet connection. In this tutorial youll see exactly how XAMPP can do splendid things to your development cycles. Were 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): were going to install XAMPP and WordPress with some test data to have WordPress right on our desktop.
This tutorial is for Windows Vista, so youll have to tweak the steps involved depending on your operating system. Heres what youll 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 youll have to tweak the steps a little bit if youre using a different operating system.
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 well 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. Download it (Save File) onto your computer. 3 Open up the executable (for Windows users, its called xampp-win32-1.7.1-installer.exe).
The following figure shows the first dialog box; it asks you to select which language you want to use.
The next dialog youll see is the first page of the XAMPP Setup Wizard.
4 Pick a destination for the installation. Note: XAMPP suggests not to install it in the Program Files folder (i.e. C:\Program Files\xampp), so just install it in the root of your drive (C:\xampp)
5 Configure your options in the XAMPP Options dialog box. For this tutorial, just go with the default installation options.
Thats it for the installation, quick and painless wasnt it? Lets fire up Apache and MySQL.
7 The XAMPP Control Panel should look like the following figure:
8 Click the Start button beside Apache. If youre on Windows, youll 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.
Congratulations, you now have your very own locally hosted (localhost) web server! Depending on your operating system, youre now the proud owner of a WAMP (Windows users), MAMP (Mac OS X users) or LAMP (badass Linux users) server right there inside your computer. Now lets move onto installing WordPress on your machine. First, were going to set up your WordPress MySQL database and create a MySQL database user for it. Thats the topic for the next section.
14 Create your WordPress database by entering in a name and pressing the Create button. In this tutorial, well call it wordpress_db. Youll need to remember this value for a later step when we configure WordPress.
18 For the User name field, type in any name, this tutorial uses wordpress_user for simplicity. For Host, select Local. For Password, type in a value, but its highly recommended that you use the Generate 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, well be using it later on. Here are the settings used:
19 Set the Global Privileges of wordpress_user. Typically, you should try to limit the privileges of your database users to a minimum to improve security. For this example, since its a local installation just check all of them. When you go into production, pare down the privileges! Hit the Go button to create the database user.
20 If everything went well, youll see a confirmation that youve created the user successfully.
This will add wordpress_user as a database user of your wordpress table, wordpress_db.
22 Check that wordpress_user has been added to the database by entering your database. To enter your database, click on wordpress_db in the left-hand navigation.
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, youve 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 well be taking. Please take a moment and read it I promise, itll be quick and painless. 24 Download the latest version of WordPress, save it on your computer. 25 Open your xampp folder. Navigate to the htdocs folder. 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.
28 Once youre done with the configuration file, save it as wp-config.php in the same folder. Note: You have to save it as wp-config.php and not wp-config-sample.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 wont be covering it here in detail.
If everything went well, you should see the default WordPress home page:
Important: take a note of the auto-generated password or else you wont be able to log into WordPress.
Alternatively, you can continue in the tutorial (because were not done yet). Next, were going to import some test data which you should do when youre developing WordPress themes to be released to the public.
35 In the WordPress admin section, go to Tools > Import (using the sidebar navigation on version 2.7).
37 Browse to the XML file we downloaded (test-data.xxxx-xx-xx.xml). Hit the Upload file and Import button.
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.
Click the Submit button. 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.
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 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.
Further resources