PHP pages need to be processed through a web server. So, to develop with PHP in Dreamweaver, you need access to a PHP-enabled web server and the MySQL database. It's also useful to have a graphical interface to MySQL. You can install all of them independently, but the quickest and easiest way is to use an all-in-one solution, such as XAMPP.
This section describes how to install XAMPP on your Windows computer. This installs the Apache web server, MySQL, and a MySQL front end called phpMyAdmin in a single operation. All three components are open source software that you can use for developing, testing, and deploying web applications—and they are free!
If you're a Mac user, see Set up PHP for Mac OS X.
This section covers the following topics:
XAMPP installs the Apache web server, which listens for requests on port 80. This is the default port used by most web servers, including Microsoft Internet Information Services (IIS). Only one web server at a time can listen on port 80. If you have installed IIS on your computer to develop with ASP or ASP.NET, you must stop the IIS web server before installing XAMPP.
If you want to test ASP, ASP.NET, and PHP without stopping and starting web servers to switch between them, you can install PHP to run on IIS. The official Microsoft IIS site has separate instructions for installing PHP on IIS6 (Windows XP) and IIS7 (Vista). After installing IIS, skip to the instructions on how to install MySQL and phpMyAdmin separately.
The following instructions assume that you don't have a web server installed on your computer, or that you intend to stop IIS when running PHP in Apache.
In Vista, you need to be logged into an Administrator account. If User Access Control (UAC) is enabled in Vista, you always need to run XAMPP from the same account. Otherwise, the XAMPP control panel won't have sufficient privileges to control Apache.
Close all applications on your computer, and double-click the installer package you downloaded.
Note: If UAC is enabled on Vista, you will see a warning about not installing XAMPP in C:\Program Files. You can ignore this warning, because the default installation location is C:\xampp.
Accept the default installation location and click Next. This opens the dialog box shown in Figure 1.
The default options, shown in Figure 1, are fine for most people.
Note: Select the options to install Apache and MySQL as services if you want them to run automatically each time you start the computer. Running Apache and MySQL as services seems to be the most reliable option on Vista. If you're not sure, choose the options shown here. XAMPP makes it easy to install them as services later.

Figure 1. These are your XAMPP installation options.
To start the Apache and MySQL servers, click the Start button alongside Apache and MySQL in the XAMPP control panel. MySQL usually starts very quickly, but it might take a little longer (less than a minute) for Apache to start. Confirmation that they have started successfully is displayed alongside, and the label on the Start buttons changes to Stop, as shown in Figure 2.

Figure 2. Start and stop the servers in the XAMPP control panel.
Note: If a Windows Security alert pops up asking whether to keep blocking the program mysql or apache, choose Unblock for both programs.
Note the following in case of errors:
If you want to enable Apache or MySQL as Windows services so they start automatically, select the Svc check box alongside each one. (FileZilla and Mercury are FTP and mail programs, which are not required to develop with PHP in Dreamweaver. They are not covered in this article.)
To secure the database:

Figure 3. The XAMPP welcome screen.
Click Security in the menu on the left of the screen. This opens a new browser window or tab with a report on the current security status of your installation. Scroll down below the status report, and click the following link: http://localhost/security/xamppsecurity.php.
This displays the screen shown in Figure 4, which prompts you to create a password for the MySQL superuser, root.
Note: Even if you are the only person using the computer, it's good practice to password protect the MySQL database.

Figure 4. Setting the MySQL root password.
Enter your chosen password in both fields. It can contain special characters, but should not have any spaces.
Note: Immediately below the password fields is a pair of radio buttons that determine how phpMyAdmin connects to MySQL as the root superuser. The default is to store it in a cookie. If you select http, you will be prompted for your root password every time you access phpMyAdmin.
If you're worried about forgetting the password, you can select the Safe plain password check box to store it in a plain text file. How much of a security risk this represents depends on who else has access to your computer.
Click Security in the menu on the left of the screen.
The status report still shows that PHP is not running in "safe mode" and marks this as insecure. This is not a problem. You should not run PHP in safe mode unless you need to reproduce conditions on your hosting server. Some hosting companies run shared hosting accounts in safe mode, but it is considered unnecessarily restrictive and will be removed from future versions of PHP.
After installing XAMPP and securing the database, test the PHP installation as described in the following section.

Figure 5. PHP configuration information.
Congratulations! You now have a working installation of PHP, MySQL, and phpMyAdmin. Although this screen might feel like information overload at this stage, it contains a wealth of information about your PHP setup. Return to this screen whenever you need to check how PHP is configured.
Note: You can display the same information by creating a PHP file containing the following script and loading it into a browser:
<?php phpinfo(); ?>
The next page deals with installation on Mac OS X, so skip to page 5 to learn how to define a PHP site in Dreamweaver or return to Part 1 of the tutorial series Creating your first dynamic site in Dreamweaver (if that's where you started).