The setup files included on the CD-ROM are suitable for Windows 98, NT, 2000, XP, or 2003. Earlier versions of Windows are not supported.
Insert the CD-ROM into your PC, and it should autoplay. If the menu screen shown in Figure 1.2 does not appear, double-click the drive icon for your CD-ROM under My Computer.
Figure 1.2. The Windows CD-ROM installation menu.
Click the button in the menu to begin installation of MySQL 5.0.20. At the screen shown in Figure 1.3, click Next to continue.
Figure 1.3. Beginning a MySQL installation on Windows.
The next few screens will contain general information regarding installation and the MySQL license. Read these screens and click Continue to move through them. The first important choice you will encounter is the installation typetypical, complete, or customas shown in Figure Figure 1.4. A typical installation will do the job here, so leave the default item selected and click Next to continue with installation.
Figure 1.4. MySQL installation type selection.
When the installation is complete, continue to the MySQL Configuration Wizard to create a custom my.ini file tailored to your particular needs. To continue on to the MySQL Configuration Wizard, check the Configure MySQL Server Now check box and click the Finish button, as shown in Figure 1.5
Figure 1.5. MySQL has been installed; now continue to the MySQL Configuration Wizard.
Select the appropriate configuration options presented on the several screens in the MySQL Configuration Wizard; consult Chapter 2, "Installing and Configuring MySQL," for detailed explanations of these options. When you have finished your configurationwhich includes the addition of a password for the root userthe wizard will start the MySQL service, which you can control through the Windows service manager (see Figure 1.6).
Figure 1.6. The MySQL Configuration Wizard completes its tasks.
Click the button in the Windows CD-ROM installation menu to begin installation of Apache 2.0.58. At the screen shown in Figure 1.7, click Next to continue.
Figure 1.7. Beginning Apache installation on Windows.
You must accept the license terms on the next screen to continue with the installation, after which you will be shown some release notes. Click Next after you have read these notes and you will be asked to enter your server information, as seen in Figure 1.8.
Figure 1.8. Entering your Apache server details.
Enter your server's domain and hostname and your email address. If you are installing on a personal workstation, use localhost and localdomain for your server information. Leave the radio button selected on the Recommended option to install Apache on port 80.
The next screen asks you to choose a setup type, either typical or custom. The typical setup is just fine, so leave the radio button selected on that option and click Next to continue.
Then you are given the opportunity to select the destination folder for the Apache files. By default this is C:\Program Files\Apache Group and this location shouldn't cause you any problems. If you wish to change it, click the Change button before clicking Next.
Finally Apache is ready to install. Clicking Install will start copying and setting up files onto your system.
When installation is complete, the Apache server and monitor program will start up and you will see a new icon in your system tray.
You can verify that Apache has started successfully by opening up a web browser and visiting http://localhost/. The default Apache page will be displayed, as shown in Figure 1.9.
Figure 1.9. Apache default installation page.
You can stop or restart the web server from the Apache Service Monitor or from the Windows Service Manager.
Click the option on the Windows CD-ROM installation menu to install PHP 5.1.4; a zip archive will open, as shown in Figure 1.10.
Figure 1.10. Beginning installation of PHP on Windows.
Extract the contents of the zip archive to C:\php and close this window when it has finished.
The installation process for PHP requires manual intervention to add the PHP module to Apache. Using the file explorer, open up the Apache configuration directoryif you used the default location it will be C:\Program Files\Apache Group\Apache2\conf and edit httpd.conf.
Look for a section that contains a number of LoadModule directives, some of which will be prefixed with a # sign. The last few lines of this section will look like this:
LoadModule userdir_module modules/mod_userdir.so #LoadModule usertrack_module modules/mod_usertrack.so #LoadModule vhost_alias_module modules/mod_vhost_alias.so #LoadModule ssl_module modules/mod_ssl.so
Add the following line to the LoadModule section to tell Apache to load the PHP module on startup:
LoadModule php5_module c:/php/php5apache2.dll
Next search for the AddType section with directives that look like this:
AddType application/x-tar .tgz AddType image/x-icon .ico
Add the following line to tell Apache to process any file ending with .php as a PHP script, as well as .html files. You can add more file extensions to this line separated by spaces if you wish:
AddType application/x-httpd-php .php .html
Additionally, add the following line to ensure that Apache knows where php.ini resides:
We also need to make a version of php.ini available. To do this, first add your PHP directory to your Windows PATH. Next, in the PHP installation directory, copy the php.ini-recommended file to php.ini. After making these changes, you must restart the Apache serveruse the Apache Service Monitor or the Windows Service Manager.
If you encounter problems starting Apache, check the system events log from Control Panel and then Administrative Tools to find the error message.
Now we're ready to check that PHP is working. In the htdocs directory in your Apache installation, create a file called phpinfo.php containing the following lines:
<?php phpinfo(); ?>
In your web browser, visit http://localhost/phpinfo.php and you should see a page giving lots of information on the PHP configuration.