Emulate Your Public_Html Folder On Windows 7
Create/Run MySQL Database, HTML And PHP Script Commands
In this section I will show you how to install a piece of software called xampp (pronounced: Zamp) which allows you to install the Apache HTTP Server
on your computer alongside MySQL Database and PHP Script interpreter. This means you can run website content on your computer as if it was uploaded to
your public_html (website) folder already.
Or put another way; You can create MySQL Databases on your computer, run MySQL Database commands, run PHP Scripts and so on. This saves you from having
to upload your website content each time you change its code for example.
Even as a non-programmer xampp can be used to install and test blog software, membership scripts, php code and so on from your computer. No need to upload your website content using an ftp client, even though xampp comes with FileZilla Server as standard, because xampp provides you with a special folder on your computer that emulates your website (public_html) folder.
UPDATE - The installation described below is for Xampp 1.7.3 (2009) which is easy to follow and use. However, as of today (5/12/2011) there is a newer
version out called Xampp 1.7.7 which is a lot easier to install than 1.7.3 as it does not require DOS manipulation by you (see below). Version 1.7.7 is an
automatic process with regards to DOS.
Saying the above; You should still read the installation notes below to familiarise yourself with Xampp, before installing version 1.7.7, as they will make the
installation process and the use of Xampp easier to understand. Alternatively you could just stick with version 1.7.3 if you prefer, for whatever reason(s).
To begin the installation, either go to the Xampp Website and download the Xampp Windows 1.7.3 [Basic Package] executable file by clicking on the EXE link (Fig 1.0) or download xampp directly from its Source Forge (Open Source) web page by clicking on the DOWNLOAD NOW! button (Fig 1.1). Either way you should end up with the Xampp-Win32 executable file inside your DOWNLOADS folder for example, which you then need to double click on (Fig 1.2) in order to launch the Installation Wizard.
Fig 1.0 Click on the EXE link, under the Windows Basic Package heading, to continue. Or.....
Fig 1.1 .....Click on the DOWNLOAD NOW! button to continue.
Fig 1.2 Double click on the Xampp-Win32 executable file to launch the Installation Wizard
With the installation wizard launched, the first thing it asks you is where you want to install xampp. In this example, below, I am installing directly
to my D:\ hard drive partition but you would normally install directly to the C:\ hard drive partition (as stated by the official xampp documentation).
Meaning, they do not recommend installation to the Program Files system sub-folder because of security issues such as UAC (User Account Control). So only
install xampp directly onto a hard drive partition or flash drive partition.
To change the installation folder, to the D:\ hard drive partition (folder) for example, simply click on the BROWSE button and then select your folder
from the Browse For Folder requester that appears (not shown here) before clicking on its OK button. With your selected folder's path name inside the
DESTINATION FOLDER edit box, of the Xampp For Windows installation window (below), click on the INSTALL button to continue.
Fig 1.3 BROWSE for a different DESTINATION FOLDER, if need be, and then click on the INSTALL button
After clicking on the INSTALL button the installation wizard begins to extract and install the necessary files to the, chosen, DESTINATION FOLDER. Note: This process can take up to 5 Minutes on average.
Fig 1.4 The installation wizard is extracting and installing the xampp files
Once the xampp files have been extracted and installed the installation wizard then finalizes the process by asking you a few questions, with the first
one being about the installation of Shortcut Icons.
In this example I have chosen not to have any shortcut icons placed on my computer by answering with a N for NO, but you might want to answer Y for YES
so that you have Start Menu shortcut icons placed on your computer as well as a Desktop shortcut icon. Regardless of your answer, you always have to press
the ENTER (RETURN) keyboard key afterwards to continue to the next step.
Fig 1.5 Do you want Shortcut Icons placed on your computer - N (NO) or Y (YES)?
The next question asked "Should I Locate The Xampp Paths Correctly?" which is basically asking you if xampp should use the default paths for installation. This option is normally used in situations whereby you have chosen non-standard destination folder paths for example, so in this example and in normal circumstances just answer this question with Y for YES (YES I want to use the default paths) before pressing ENTER.
Fig 1.6 Answer with Y for YES in normal circumstances
Question 3 asks you if you want to make xampp portable (i.e. installed on a Flash Drive). Again, in normal circumstances just answer N for NO before pressing ENTER to finish off the final steps of the installation process (Figures 1.8 to 1.10).
Fig 1.7 Answer with N for NO in normal circumstances
Fig 1.8 Xampp has been installed. Just one more answer to clarify.....
Fig 1.9 .....Press the ENTER (RETURN) keyboard key to continue.
Fig 1.10 Xampp has been installed - Press x and then ENTER to exit the installation wizard.
Now that xampp has been installed double click on the xampp desktop shortcut icon to launch the Xampp Control Panel. In this example I went to the D:\xampp folder and created a desktop shortcut icon from the xampp_control.exe file. I then renamed that desktop shortcut icon to xampp. This is why I avoided the creation of the, unnecessary, xampp Start Menu shortcut icons during the installation - Start Menu icons, in these cases, are a waste of Start Menu space.....in my humble opinion!
Fig 1.11 Double click on the xampp desktop shortcut icon to launch the Xampp Control Panel
Fig 1.12 Xampp Control Panel - Click on the START button to start a service
When the xampp control panel launches click on the START button of each services you want to run. In this example (above) I only want the main Apache Server and MySQL Database services running. I do not need the FileZilla (FTP) Server service running for example because I will not be uploading any files to my actual webspace (public_html (website) folder) and even if I wanted to I would use the standard FileZilla (FTP) Client software already installed on my computer as a separate piece of software.
Once the required services have been started, which can be stopped at any time by clicking on their relevant STOP button, you can then go to the xampp folder and place your website content inside its HTDOCS sub-folder. This HTDOCS sub-folder is where you can test your PHP Scripts and so on.
Fig 1.13 The default website content from the xampp installation - Replace it with your website content
Fig 1.14 The default xampp website content has been replaced with mine, a part from the xampp folder.
If you want to get to the MySQL Database admin area, to set up a MySQL Database for example, simply click on the ADMIN button next to the MySQL Database service on the xampp control panel. This will take you to the phpMyAdmin control panel, which is exactly the same as the one used in your web hosting package CPanel control panel.
Fig 1.15 Click on the ADMIN button to launch the phpMyAdmin control panel
Fig 1.16 Create a MySQL Database and so on from this phpmyadmin control panel
Finally. To preview your web page changes for example inside a web browser, such as Internet Explorer or Firefox, just enter the URL: http://localhost/.
Fig 1.17 To view a website enter the URL http://localhost/ into your web browser's Address Bar edit box
Although xampp is really for the programmer there is nothing stopping the absolute beginner from placing PHP Scripts and so on inside the HTDOCS folder
and running them for test purposes for example.
In the example below I have used the phpMyAdmin control panel to create a MySQL User with ALL PRIVILEGES and then a MySQL Database, so that I could then
install a Wordpress Blog.
Fig 1.18 A Wordpress Blog locally installed inside the HTDOCS folder
As you can see; Xampp can be a very useful tool for testing certain MySQL and PHP Script website content such as Blog scripts, Forum scripts, PHP File Operation Code (i.e. Password scripts) and so on.