Windows Installation

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.3 does not appear, double-click the drive icon for your CD-ROM under My Computer.

Figure 1.3. The CD-ROM installation menu.

Installing MySQL

Click the button in the menu to begin installation of MySQL 4.0.21. At the screen shown in Figure 1.4, click Next to continue.

Figure 1.4. Beginning a MySQL installation.

Click Next again after you have seen the release notes, and the next screen allows you to choose the destination location for the MySQL files. If you change from the default of C:\mysql, be aware that the path used in subsequent steps will also need to be changed.

The next step is to choose the setup typetypical, compact, or customas shown in Figure 1.5. A typical installation will do the job here, so leave the default item selected and click Next to begin the installation.

Figure 1.5. MySQL installation type selection.

Once the installation program has finished, open up the file explorer to C:\mysql\bin (if you changed the installation location previously, this will be relative to the folder you selected) and run winmysqladmin.exe. The application will be using the MySQL default username (test) and password (test).

Having done this, the traffic light icon in your system tray indicates the status of the MySQL serverit should be green. Click the traffic light and select Show Me to bring up WinMySQLadmin, which shows the connection information for your server as seen in Figure 1.6.

Figure 1.6. WinMySQLadmin shows the status of your MySQL server.

Installing Apache

Click the button in the menu to begin installation of Apache 2.0.52. At the screen shown in Figure 1.7, click Next to continue.

Figure 1.7. Beginning Apache installation.

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 once you have read these 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, hit the Change button before pressing Next.

Finally Apache is ready to install. Pressing Install will start copying and setting up files onto your system.

Once installation is complete, the Apache server and monitor program will start up and you will see a new icon in your system tray. Double-click this icon to bring up the Service Monitor, which will look like Figure 1.9.

Figure 1.9. The Apache Service Monitor.

The green light next to Apache2 shows that the service is running and you can verify this by opening up a Web browser and visiting http://localhost/. The default Apache page will be displayed, as shown in Figure 1.10.

Figure 1.10. The default Apache page.

You can stop or restart the Web server from the Apache Service Monitor using the buttons on the right-hand side. Make sure Apache is not running before continuing to install PHP.

Installing PHP

Click the option on the CD-ROM menu to install PHP 5.0.2 and a self-extracting zip archive will open, as shown in Figure 1.11.

Figure 1.11. Beginning installation of PHP.

Change the extraction location to C:\php5 and click Extract; the files will be extracted to your system. 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\confand 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/ #LoadModule usertrack_module modules/ #LoadModule vhost_alias_module modules/ #LoadModule ssl_module modules/ 

Add the following line to the LoadModule section to tell Apache to load the PHP module on startup:

 LoadModule php5_module c:/php5/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 .phtml and .html files. You can add more file extensions to this line separated by spaces if you wish.

 AddType application/x-httpd-php .php .phtml .html 

We also need to copy php.ini and a DLL file to a system location. Under C:\php5 you will find php.ini-recommended and php5ts.dll. Move php.ini-recommended to your Windows directoryusually C:\WINDOWS or C:\WINNTand rename it as php.ini, and move php5ts.dll to where your DLLs are storedusually C:\WINDOWS\SYSTEM or C:\WINNT\SYSTEM32.

To make sure these changes take effect, restart Apache from the Apache Service Monitor. The light next to the Apache2 service should change from red to green indicating that Apache has started.

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 make sure the PHP information page appears, as in Figure 1.12.

Figure 1.12. The phpinfo() page on a Windows system.

Sams Teach Yourself PHP MySQL and Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (4th Edition)
ISBN: 067232976X
EAN: 2147483647
Year: 2003
Pages: 333
Authors: Julie Meloni

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: