Datasheet
P1: KTX
WY027-01 WY027-Mercer WY027-v2.cls June 5, 2004 0:44
Getting Up and Running
ClearModulesList line in the file, you need to add the following line to the file. Although it doesn’t
matter where you put it, it makes sense to locate it near other AddModule lines for easy access in the
future:
AddModule mod_php5.c
The AddModule line is not required unless you have a ClearModulesList line.
Finally, you tell Apache how to recognize a PHP program file by its extension. Further down the
document are some directives that begin AddType. To the end of these, add the following line:
AddType application/x-httpd-php .php
This tells Apache that all files that end in.php are PHP programs. Now you’re done, so save the file.
Starting or Restarting Apache
Check to see if Apache is running by going into Services once again and checking the httpd service. If it’s
not running, start it. Verify that it’s running by opening the http://localhost test page. If everything
seems to be working OK (and you’re not also installing on Windows), move on to the “Testing Your
Installation” section to test that PHP is working properly.
The majority of Web hosting computers runs some version of Linux, such as Debian, RedHat, FreeBSD,
and so on. The Web server of choice for these machines is Apache. PHP is compatible with Linux and
Apache, so you can install and configure PHP on these systems. However, if you are not in charge of the
Web hosting computer (and many times you won’t be) you’ll probably have little control over the
installation and configuration. If you find yourself in this position (for example, if you’ve been hired to
work on an existing Web site running on someone else’s server) you can simply verify the operating
system, Web server software, and PHP version so you can cope with whatever you’ve got as you develop
your PHP programs.
Installing PHP5 on Windows 2000/Internet
Information Server (IIS) 5
Before beginning the installation process, let’s take a look at IIS. If it’s been properly installed using the
default settings, it should already be running. Select Start
➪ Programs ➪ Administrative Tools ➪ Services
and scroll down to World Wide Web Publishing Service to see if IIS is currently running. If it isn’t, start it up
If you need to install IIS, go to Settings
➪ Control Panel and open Add/Remove Programs. Then click the
Components button to find the list of components that can be installed in Windows 2000, including
Internet Information Server. Select IIS and then click the Details button to see all the services (such as FTP,
SMTP, and so on) that can be installed. Choose any you’d like, but be sure to include World Wide Web
Publishing, and click the Finish button. IIS should be installed and running.
You can examine the installation of IIS by opening its documentation from your browser, using
http://localhost/iisHelp as the URL. You should see something like Figure 1-11, which shows IIS
5.0 running on Windows 2000.
19