Configuring Your Home Computer to Run Apache Server, PHP, MySQL, ColdFusion, and IIS
This tutorial for installing WAMP Server (Apache, PHP, MySQL, and phpMyAdmin) was written for the students in the Web Page Design program at the Contra Costa ROP. This tutorial will cover basic server installation for web development testing purposes on your home computer. This tutorial will not cover all of the necessary security settings used to create a public web server.
We currently use three texts for web database development:
Macromedia Dreamweaver MX 2004 - ISBN 0-619-21420-1 - Covers Dreamweaver from the ground up. This text also includes an introduction to web database development using PHP/MySQL and ASP/Access. This book is required for all students in the program.
Dreamweaver MX 2004 with ASP, Coldfusion, and PHP - ISBN 0-321-24157-6 - Covers some basic Dreamweaver functions, but the reader should have some prior experience using Dreamweaver to fully comprehend the text. Students can learn the basics of three different scripting languages, PHP/MySQL, ASP/Access, and Coldfusion/Access, by completing this book. Elective course.
Sams Teach Yourself PHP, MySQL, and Apache - ISBN 0-672-32489-X - For students who would like to learn how to hand-code PHP/MySQL applications. Elective course.
Definition of Terms
PHP: Hypertext Preprocessor is a scripting language that is embedded in HTML. PHP scripting code is frequently used to connect web pages to MySQL databases to create dynamic web sites. Some popular examples of PHP driven web sites would be blogs, message boards, and Wikis. PHP files are actually plain text files; they can be created in TextPad or any other Plain Text Editor. In a text editor set the Save As type to text and save the file with a .php extension. Note: You must type the .php yourself. PHP files can also be created with Dreamweaver MX 2004. PHP is "open source" and therefore free. We use the Apache Server to work with PHP files in the classroom.
MySQL is a relational database system. MySQL uses "Structured Query Language" which is the most common database language. It is the most popular "open source" database in the World. MySQL content can be managed via a command line or a web interface. MySQL is "open source" and therefore free. We use the Apache Server to work with MySQL files in the classroom.
Coldfusion is another scripting language used to connect to databases. It performs essentially the same functions as PHP, but it is produced by Macromedia. There is a free developer edition of Coldfusion available on Macromedia's web site. We use the Apache Server to work with Coldfusion files in the classroom.
phpMyAdmin is a popular PHP driven web interface that allows you to manage your MySQL database content via a web form. It is much easier to learn to use phpMyAdmin to manage your MySQL database content than it is to edit it from the command line. phpMyAdmin is "open source" and therefore free.
Apache is a popular web server that many ISP's and individuals use to host web pages. When you install Apache on your system your machine becomes a web server. Pages stored on your system in a "special folder" are accessible on the Internet via the machine's IP address. In order for pages to be viewed on the Internet, the files must be stored in a special directory; this directory is usually called htdocs, public_html, or www. If you use a web host, you probably upload your files to a directory with one of these names. If someone else wants to access your web pages, they must know the IP Address of your machine, i.e., 179.199.9.100. Apache is "open source" and therefore free.
IIS or Internet Information Server is Microsoft's web server. It performs the same functions as Apache and is used with ASP and Access files primarily, but it can also run PHP and MySQL. It can be installed on Windows based machines (Windows 2000, Windows XP, etc.). IIS is available on the Windows installation CD. Typically you will install Apache or IIS; both servers services should not be running on your machine at the same time. IIS is needed to run ASP/Access applications.
Windows Services are used to run these servers and modules. Once services are installed they can be started and stopped via Start > Control Panel > Administrative Tools (switch to classic view if you do not see the Administrative tools) > Services. These Services can be configured to automatically start or to be started manually. The Apache Service and the IIS service should not run at the same time. This will be discussed in more detail later in the tutorial.
PHP and Coldfusion Testing Requirements
In order to test PHP and Coldfusion pages you must have Apache, MySQL, and the PHP and/or Coldfusion module installed on your own computer or have a host that supports PHP or Coldfusion. You can use your f2o.org account, but it is much easier to test your PHP pages on your local machine. If you do not have these modules installed, you would have to upload your PHP pages to your ISP to view them. The beauty of Apache, MySQL, and PHP is that they're free. If you are working in the classroom and you are creating PHP web pages, you must start the Apache Web Server at the beginning of class each day.
WAMP5 Server Setup
Apache, MySQL and PHP are already installed on our systems. We are using a free server bundle called WAMP5 for Windows which includes Apache, MySQL, PHP, and phpMyAdmin. It is very easy to install and it can be obtained from the WAMPServer home page. While you can install Apache, MySQL, and PHP as separate modules, it is much easier to install the WAMPServer bundle. If you have never worked with server software than I would definitely recommend using the WAMP bundle. If you want to work at home, follow these steps to install WAMP5 on your home system. Note: Please do not install WAMP on the classroom systems.
Installing WAMP5 Server
You can download a free copy of the WAMP5 Server from the WAMP Server home page. Download the most recent version of the server into a folder on your hard drive. The file name will be similar to wamp5_1.43.exe. Locate the downloaded file and double click the file to launch the installation.
The WAMP5 Setup Wizard will appear. Click Next.
The License Agreement screen will appear - Accept the agreement and click Next.

At the Select Destination Location you can change the install directory. The default is C:\wamp. We use the default directory in the classroom. Click Next.

Select the Start Menu Folder. We use the default WampServer folder in the classroom. Click Next.

You can set WAMP to automatically start each time Windows start. I would recommend that you do not check this option. This could cause security issues on your home computer if you were to leave the server running whenever the computer is turned on. You should manually start your WAMP/Apache server when you need it. Click Next.

At the Ready to Install screen, click Next.

The Installing screen will appear indicating the installation process.

You will need to select the default publishing folder or DocumentRoot folder. This is the folder that you store your web site in. Any files that are placed in this folder will be available on the Internet by typing in the IP address of the machine. You will use this folder as the Testing Server Folder when you are working in Dreamweaver. The path to the folder is C:\wamp\www. Click OK. On a web host you usually store your files in a folder called www or public_html; this procedure is setting up that storage folder.

At this screen you will select your default web browser. In the classroom we have left Internet Explorer as the default browser. No changes were made to this screen. If you prefer to use another browser like Firefox or Opera you will have to navigate to the executable *.exe file of the browser. Click Open.

If necessary, check Launch WAMP5 now and click Finish to complete the Installation.
The installation is complete and the WAMPServer will Start.

This will launch Apache, PHP, and MySQL. A new icon will appear in the task bar
to the left of the clock. When you click the WAMP menu icon
a menu will appear. From the Wamp Menu you can start and stop the server (Start All Services or Stop All Services) on your machine and you can administer the MySQL databases with phpMyAdmin. This will be covered in greater detail later in the lesson.
To start the server at home, click Start > All Programs > WampServer > Start WampServer. Click the WAMP5 Server icon
in the task bar and select Start All Services.
In the classroom you will need to click Start > All Programs > Web Design > WampServer > Start WampServer to start Apache, PHP, Coldfusion. Click the WAMP5 Server icon
in the task bar and select Start All Services.
Setting a MySQL Password
Note: We have already configured WAMP in our classroom, please do not change the passwords, users, or configuration files.
Once you get WAMP5 installed, you will want to change the MySQL password. When you first install WAMP5 passwords are not set. If you do not password protect your MySQL tables your are leaving your machine open to hackers. You can change the password by clicking the WAMP5 Server icon
in the task bar and selecting phpMyAdmin. This will launch Internet Explorer and the phpMyAdmin web interface. Locate the Privileges link and change the Privileges as directed in this Password FAQ. You will want to be sure to change the 'root' password.
After you change the MySQL password you will have to edit the config.inc.php file typically located in C:\wamp\www\phpmyadmin. Open this file with a text editor and scroll to approximately line 85. The code should look something like this:
![]()
You will need to type your new password between the two single quotes as directed in the above image. Do not delete the quotes.
Setup PHP E-mail
Note: We have already configured WAMP in our classroom, please do not change the passwords, users, or configuration files.
The php.ini file, located in C:\wamp\apache, is used to configure the PHP module. A text editor can be used to edit the php.ini file.
In order to test mail functions on your PHP pages you will need to configure the mail function in the php.ini file so that you can send e-mail. Click the WAMP5 icon
and select Config Files > php.ini. Look for the [mail function] section of the file located around line 594. You will need to know the SMTP address (used to send e-mail) of your Internet Service Provider. This would be the same address that you use in Outlook or Outlook Express as your SMTP server. The SMTP address uses a format similar to this mail.yourwebhost.com, smtp.yourwebhost.com, or pop.yourwebhost.com. You will also need to type your e-mail address after the equal sign in the sendmail_from line.
[mail function]
; For Win32 only.
SMTP = mail.yourwebhost.com
; For Win32 only.
;sendmail_from = youremailaddress@yourhost.com
Storing files for Use with WAMP5 Server
To create a new WAMP5 web site, create a folder in C:\wamp\www with Windows Explorer. This folder name should not include spaces or special characters. Store all of your web site files in this folder. In the classroom, please include your PM## in the folder name.
Coldfusion Installation
Once Apache has been installed on your system you can install the Coldfusion module. The Coldfusion Developer edition is available for download (free) from this address http://www.macromedia.com/cfusion/tdrc/index.cfm?product=coldfusion. You will have to sign up for a Macromedia account in order to download the software; signup is also free.
Depending on your system configuration (Windows 2000 or older), you may have to download and install the latest Microsoft Data Access Component (MDAC). This file can be found here http://www.microsoft.com/downloads/details.aspx?FamilyID=6c050fe3-c795-4b7d-b037-185d0506396c&DisplayLang=en. If this file needs to be updated on your computer, you will receive a warning when you attempt to install Coldfusion. You cannot install Coldfusion without the correct version of the MDAC file. I found that I have had to run this installation on all of the machines that I have attempted to install Coldfusion on. You will have to restart the computer when the installation has finished.
After downloading the Coldfusion software, double click the installation file coldfusion-61-win.exe. The installation process will begin.
- Select English and click Ok.
- Click Next at the Introduction Screen
- Accept the License Agreement and click Next
- At the Install Type Screen select Developer Edition (Single-IP Only) and click Next
- At the Install Configuration screen select Server Configuration and click Next
- Do not change the install directory, click Next
- At the Web Server selection click Add and select Apache as the Web Server. Click the ellipse next to the Configuration Directory and double click the wamp folder then double click the apache folder. Click once on the conf folder and click Select. Click the ellipse next to the Server Binary and double click the wamp folder, then double click the apache folder then scroll down and click once on the Apache.exe file and click Select. Click OK and click Next.
- The Administrator Location directory should already be set to C:\wamp\www, click Next.
- Use a password you can remember and click Next. Click Install.
Coldfusion will be installed on your system. Coldfusion will automatically start when you start WAMP Server.
Installing IIS, Internet Information Server, on Windows XP Professional
If you plan to create ASP/Access driven web sites you will need to setup IIS as a testing server on your system. The WAMP5 Server should not be running.
Note: You will probably need the Windows XP Professional CD to complete this installation.
Click Start > Control Panel. Select Add or Remove Programs.
Click Add/Remove Windows Components from the menu on the left-hand side of the Add/Remove Programs dialog box.
From the Windows Components dialog box check Internet Information Services (IIS) and click Next. You many be prompted to insert your Windows XP Professional CD.
Click Finish.
Storing files for Use with IIS
To create a new WAMP5 web site, create a folder in C:\Inetpub\wwwroot with Windows Explorer. This folder name should not include spaces or special characters. Store all of your web site files that you want to test in this folder. In the classroom, please include your PM## in the folder name.
IIS and Databases
Any Access database that you want to be able to edit with a web page must have special permissions setup. These permissions are given to the Internet Guest Account which is a special account that IIS uses when visitors browse your web site. If you do not apply "write" permissions to the database file you will get an error message when you attempt to update the database from a web form. To change the security settings for your database, open Windows Explorer and locate the database in the C:\Inetpub\wwwroot\subfolder. Right click the database and select Properties. Select the Internet Guest Account and place check marks in the Allow column for Read & Execute, Read, and Write as indicated in the image to the right. Click OK.
Special Note to Students: I received an error when I attempted to view my contact.asp page in Internet Explorer as directed on page 518 of the New Perspectives Dreamweaver MX 2004 book. The error was:
"Server object error 'ASP 0178 : 80070005'" Server.CreateObject Access Error.
I found the solution for this error at Microsoft's web site. The folder C:\ProgramFiles\Common Files\System folder must be granted Read permissions to the Everyone group. In Windows Explorer, right click the folder and select Properties. Click Add and type Everyone and click Ok. Select Everyone and check the Read permission under the Allow column and click Ok.
Stopping the IIS Server to Use Apache
The IIS server is a Windows XP service. If you want to work with the WAMP5 server after installing IIS you will need to stop the Internet Information Server Service. Apache and IIS can not both be running at the same time. Click Start > Control Panel (switch to Classic view if necessary) > Administrative Tools > Services.
The Services running on your system are in alphabetical order. Scroll until you locate the IIS Admin service. Right click the IIS Admin and select Properties. Change the Startup type to Manual and click Stop to stop the service. A prompt will appear asking if you want to also stop the SMTP (mail) service and the World Wide Web Publishing Service, click Yes. Click Ok. Locate the Simple Mail Transfer Protocol service and set the Startup type to Manual. Locate the World Wide Web Publishing Service and set the Startup type to Manual. If you want to start the IIS server at a later date you will need to return to the Services settings and restart these three services. You can also change their startup type back to Automatic, but I think it's more secure to start them when you need them rather than having them running whenever your machine is turned on.
Previewing Web Pages Using a Testing Server
Make sure that the testing server you are using is running. As I mentioned earlier you must save your PHP, ASP, Coldfusion web pages into a special folder in order to preview them in Internet Explorer.
IIS/ASP - C:\Inetpub\wwwroot
PHP/Coldfusion/Apache - C:\wamp\www
Depending on the server you are using, you must create a subfolder within one of the above directories. You can create the subfolder using Windows Explorer or My Computer. If you are working in the classroom, please include your PM## in the subfolder name.
If you are working with Dreamweaver I have some screen captures of the remote and testing server settings for working with WAMP here.
If you want to preview your pages you must use a special web address, http://localhost/subfoldername/filename.php (or .asp or .cfm depending on the scripting language you are working with). This address is the same for both IIS and Apache servers and this is one of the reasons why you should not attempt to run both servers at the same time. You will need to type the http://localhost/subfoldername/filename.php into your web browser's address bar; you cannot use the open file feature to navigate to the file.
I have some directions written up for my students for setting up the testing server settings in Dreamweaver using IIS. You may find them helpful if you want to use Dreamweaver to edit your site.
A BRIEF Introduction to Working with phpMyAdmin
Before you begin working with phpMyAdmin I would recommend that you have some experience working with databases. At the very minimum, you should understand the following terms: database, table, query, record, columns, rows, and structure. If you are a student in my class you should complete the Access tutorial prior to working with MySQL. After reviewing the Access tutorial, review Basic Relational Database Concepts/Design, The SQL Language, & The mySQL Database Server and the PHP and MySQL tutorials at Tizag.
Traditionally, a command prompt is used to create, edit, and manage MySQL. This command prompt is very similar to a DOS prompt. :( Fortunately, an open source web tool has been developed to manage MySQL called phpMyAdmin. phpMyAdmin is automatically installed with WAMP5. Access phpMyAdmin by clicking the WAMP5 icon
and selecting phpMyAdmin.
Importing SQL Files Using phpMyAdmin
Most of the books that we use in class will include MySQL files with the exercises. These SQL files have an *.sql extension and can be imported into the MySQL database using phpMyAdmin. To import an existing MySQL database use the following procedure:
phpMyAdmin uses a frameset design. The left frameset includes the logo, a few menu options directly below the logo, and a drop down list for selecting the database that you want to work with.
Click the SQL menu icon
. This will open a new smaller browser window with a menu at the top of the screen:
Click Import Files.
In the Import Files box click the Browse button. Navigate to the sql file you want to import, select it, and click Open. Click Go to complete the import process.
Note: On page 234 of the Dreamweaver MX 2004 with ASP Coldfusion, and PHP book the reader is directed to use the MySQL command prompt to import a database. Instead, phpMyAdmin can be used to import the database for use.
Before editing a database with phpMyAdmin, you will usually need to select a database to work with. Select a database by clicking the Database drop down menu and then selecting the database to work with.
After selecting a database, the right frame will change. A list of tables will appear with detailed information and editing options or a Create Table frame will appear (that will be covered in a moment).

Notice the top of the area outlined in orange. This area displays your location in the database. It is important to know where you are within a database so you do not inadvertently delete databases, tables, or records. The menu below allows you to perform common database functions including: Checking the structure, inputting SQL commands, exporting the data to a file, searching the database, performing a query on the database, and deleting (drop) the database.
The first column (checkboxes) of the above table is used to select tables for editing or dropping (deleting). The second column (Table) displays the individual tables within the database. The Action column is used to edit the table properties or content. The table below shows the purpose of each of the Action buttons.
| Browse - click this button to display the data in the table | |
| Search - click this button to search the data in the table | |
| Insert - click this button to insert data (a record) into the table | |
| Properties - click this button to edit the structure of the table | |
| Empty- click this button to delete the "contents" of the table. This will not delete the actual table | |
| Drop - click this button to delete the entire table | |
The Records column shows the number of individual records within a table. The Type column indicates the type of table being used. Collation is the language/character set and finally, size indicates the KB of the table.
Notice the left frame of the web page. After selecting the database a list of links will appear below the drop down menu. These links are links to the individual tables within the database. You can click each of these "shortcut" links to work with the individual tables within the database. Notice the names of the tables to the right. A commonly used naming convention for MySQL tables is a common prefix, an underscore, and the table name. Because you may have many tables that work with different PHP applications within the same database it's a good idea to give the tables that work together a common prefix. For example. Here are a few common prefixes that I use for some of my PHP/MySQL applications:
b2_
wp_
xoops_
Click any table name to access the individual table editing features.
After selecting the table the right frame displays information about the selected table. Remember to keep track of what you are editing at the top of the frame. The menu below contains some of the common table editing features. The menu items are for the most part the same as the database menu, but clicking the Browse button allows you to see, edit and delete of the data within a table. This is a feature that I use frequently with phpMyAdmin. Insert allows you to insert new data into a table. Operations will allow you to move, rename, copy and alter tables; this is another handy feature.
The right frame also displays the table fields, types, character sets, special attributes, Null (can the field be empty), the default content, extra information, and another set of action buttons. The Action buttons allow you to handle how the data is stored in each field of the table. You can change the structure of the data field, delete the field, set the field as a primary key, index the field, make the field unique and add full text.
Creating a Table
Note: If you have not worked with databases (Access for example) in the past, you should take the introduction to Access class prior to working with PHP/MySQL so you can learn basic database concepts).
Just a note: On f2o.org you cannot create actual databases, but you can create as many tables within your existing database as you want.
When you are working on a database project, you need to plan your tables, their structure, and their content. Tables consist of fields; you must determine what fields will be needed in your table and the field type before you create the table because you must tell phpMyAdmin how many fields the table will need when you create it. For example, for this exercise I want to create a table for a guest book. I have decided that I will need six fields:
| Field Name | Field Type | Length | Default Value | Extra Info | Primary Key |
| id | int | 11 | auto_increment | Yes | |
| date | datetime | 0000-00-00 00:00:00 | |||
| name | varchar | 100 | |||
| varchar | 100 | ||||
| url | varchar | 200 | |||
| comment | text |
Once you have determined the database structure, you must select the database that you want to create a table within in phpMyAdmin. If there are no tables in the database the Create Table form will appear. If you already have tables in your database, the Create Table form will be at the bottom of the page.
You will need to give the database a name. Each table name within a database must be unique. You may have several tables that are related to each other. Frequently, a prefix is added to the table name to indicate related tables. In the image to the left the prefix, rw_ has been added to the guest table. Any other tables that will work with the guest book will have the prefix rw_. Another example is is the wp_ prefix. This prefix is used for WordPress tables.
After typing in the table name and the number of fields, click Go.
Next you will be presented with an empty form (image above) that is used to create the field names and set the properties of each field. Here you give each field a name and set the type of field (int (number), datetime, varchar (up to 255 characters), text (up to 65,535 characters), tinytext (up to 255 characters-no indexing). You can set a maximum length, set default formatting, set auto_increment, and set primary keys. There are a lot of different properties that can be set in a table, DayDreamGraphics has a tutorial which outlines field properties and basic table creation in MySQL that I would recommend that you read. After completing the form, click Save.

The table creation may take a few seconds, or a minute or two depending on the connection speed, the size and detail of the table, etc. Once the table has been created a message will appear confirming the successful creation of the table. Below the table creation message the actual SQL code used to create the table will also be displayed.
The table structure will also appear below the SQL-query syntax.
Inserting Data
You can insert data into the table by clicking the Insert tab (see image above). Simply complete the form and click Go to add a record to the table.
Exporting a Database
You will want to make periodic backups of your SQL databases and tables. You may also want to move to a new host. To backup your SQL data, use the following procedure:
Select your Database

From the menu, select Export
From the Export page uncheck Add Auto_Increment Value. Check Save As File and type a filename in the template box. Click Go.
This should give you some basic knowledge of phpMyAdmin. Part II of the tutorial deals with moving a site from a testing server to a live server.
Part II - Uploading Your Finished Site to a Web Host and Importing SQL Queries
If you live in the San Francisco Bay Area and you're interested in learning more about web design and development, graphics, or computers in general, consider taking classes at the Contra Costa ROP Technology Center. We offer affordable computer training in a variety of subjects. Visit our web site for more information.
Stop by my Amazon Store for gifts for the web developer.
Visit Robin's Blog for more web design and development resources.
©Copyright 2001-2006 - Robin Wood - Send Questions or comments to robin at tinkertech dot net.
Last Updated:
December 19, 2006
