Installing and Configuring Xampp on Windows

xampp-shortcutIf you are developing for the web then having access to your own test sites is essential.

In this tutorial we will look at installing and configuring Xampp for multiple test sites.

Xampp Installation

The basic install is very straightforward:

  1. Download the install files from Apache friends website
  2. Click the .exe package to start the install and follow the instructions.

This WikiHow covers the install if you get stuck.

The install should create an icon in the start menu for the XAMPP control panel.

You can use this control panel to locally administer the installation.

Understanding The Install

First we will look at the files. Locate the XAMPP directory. In my installation it is directly under the C: drive.

xampp-directory

If you open the XAMPP directory you will something like the screen shot below.

xampp-fiolders

The important files and directories are:

  • htdocs folder-This will contain your websites- location under xampp directory
  • apache folder -location under xampp directory
  • httpd-vhosts.conf – This will need to be edited to configure virtual hosts -file location under xampp/apache/conf/extra/ directory.
  • httpd.conf file. Main Apache configuration file.This will beed to be edited to use virtual hosts – location under xampp/apache/conf/ directory.

This Video cover the main point from above.

Set up Virtual Hosts

You will probably want to run multiple test sites on the server. To do this you will need to.

  • Edit the httpd.conf file
  • Edit the httpd-vhosts.conf file
  • Edit the hosts file on client PCs.

The httpd.conf file is located in the xampp/apache/conf/ directory.

You will need to locate the Virtual hosts section and un-comment out the line that includes the httpd-vhosts.conf file.

edit-httpd-virtual-hosts

Editing The httpd-vhosts.conf  File

The file is located under xampp/apache/conf/extra/ directory.

The file will contain an example configuration. To create your own virtual host you simple copy a section of the file and edit it.

The section you need to copy is located between the <VirtualHost *:80> and closing </VirtualHost> tags.

Don’t forget to remove the comment tags!

edit-vhosts-config-file

This video covers creating virtual hosts

Editing the Local Hosts File

This you will need to do on clients that are accessing your test sites.

On Windows the hosts file is located here: C:/Windows/System32/drivers/etc/hosts

On Windows 7 and above you will need to open the hosts file in a text editor in admin mode so as you can save changes.

Add entries in your hosts file for your test sites. Mine looks like this:

example-hosts

Enabling PHP Email

In order to send email from PHP scripts and applications like WordPress you will need to make some changes to the PHP.ini file and the sendmail.ini file.

The php.ini file is located in xampp/php/

You will need to set the sendmail path by commenting out the default path and un-commenting another path as shown below.

configure-php-email-xampp

The sendmail.ini file is located in the xampp/sendmail folder.

If you haven’t got a local SMTP server installed then you can use and external SMTP server e.g.Gmail.

For this you need a valid email address e.g. a Gmail email account.

You will need to change the server address and server port, and the username and password as shown below.

xampp-sendmailini-1

Basic XAMPP Use

To open the Control Panel click on the Xampp icon on your desktop.

You can start and stop the Xampp services,edit the configuration files and Manage MYSQL database through phpMyAdmin

xampp-control-panel

You can also access xampp control panel remotely using a web browser by going to the IP address of the machine running Xampp or if you have configured your virtual hosts and hosts files correctly you can use a domain name as shown below.

xampp-browser

Tips:

  1. Create shortcuts on your desktop to the important files and folders for easy access.
  2. Share the Xampp and htdocs folders So you can edit them remotely.

Resources and references:

Save

Save

Save

Did this Tutorial Help? Please Rate
[Total: 1 Average: 4]