Datasheet
P1: KTX
WY027-01 WY027-Mercer WY027-v2.cls June 5, 2004 0:44
Chapter 1
that you may need to rewrite your code a little bit to work properly with the recommended file’s
configuration settings. We’ll discuss this more as we go along.
Setting Up a Test Machine
In this chapter, we’ll walk through setting up PHP5 on a Red Hat Linux machine running the Apache
Web server, as well as on a Windows 2000 machine running Internet Information Server (IIS). You can run
PHP5 with many other operating systems and Web servers, so see the PHP5 documentation for
installation and configuration on other servers. And there are a variety of installation methods you can
use. For example, there is an automatic installer for the Windows version, whereas you can install the
Linux version using RPMs (for some versions of Linux), and you can also download and compile the
Linux versions from the original source code if you like. None of the installations are all that difficult if
you follow procedures correctly, and the examples we provide are a good starting point for many of the
installations available.
There are some third-party installers (often open-source and free) out there, if you want to look for them.
For instance, you might try PHPTriad or Foxserv in Google.
Network Connections
If you don’t already know, a computer doesn’t need to be attached to the Internet, or even to a network,
to run Web server software. If you install a Web server on a computer, it’s always possible to access that
Web server from a Web browser running on the same machine, even if it doesn’t have a network card or
modem. Of course, to download and install the software you need, you have to have access to an Internet
connection. But you don’t need it to be active just because you’re running your Web server.
Once you have a Web server installed and running, you’ll install PHP5 alongside it. There’s some
configuration required to tell the Web server how to run PHP programs, and we’ll walk through that
process before we start PHP. There is an automatic installer to be found with most distributions of PHP;
we’ll use a primarily manual process to illustrate what’s happening during installation.
What if it goes wrong? The README and INSTALL files that are included in most PHP
downloads, as well as the PHP manual at www.php.net/manual/, provide detailed
information which may be more up-to-date than the information here, which covers
the PHP5.0.2 release.
Where Do You Start?
There are two main installation paths from which to choose, and each simply depends on which
operating system you’re using:
❑
Installing PHP5 with the Apache Web Server on Linux (we use Red Hat Fedora Linux)
❑
Installing PHP5 with Microsoft Internet Information Server on Windows (we use Windows 2000)
4