Datasheet
P1: KTX
WY027-01 WY027-Mercer WY027-v2.cls June 5, 2004 0:44
Chapter 1
Installing PHP5 with Linux and Apache
At the time of this writing, the very first release candidate of PHP5 was available, and that’s the one we’re
using. But you may want to check the PHP site for more recent versions, and any notes about changes.
The combination of Linux, Apache, MySQL, and PHP is probably the most common production
environment for running PHP Web servers. This combination of open-source software has been referred
to by the acronym LAMP. If you run the same combination of software, you can benefitfromthe
experiences of the many other people who’ve used this setup.
The PHP developers work very closely with the Apache and MySQL teams to ensure that advances in the
three server systems are fully supported by the other components. However, at the time of this writing
PHP5 is being distributed with SQLite rather than MySQL, because there is some concern about whether
MySQL is still open source. This may not be a concern when you read this and begin developing, but it’s
worth noting.
Choosing Your Installation Method
As with other open-source software, you have the option of downloading the PHP and Apache source
code (which, in both cases, is written in the C programming language) and compiling the programs
yourself. If that sounds daunting (it’s not actually as scary as it sounds), you can obtain precompiled
versions in one of two forms: binary downloads, which are precompiled versions of the software that
typically come with installation scripts to put all the required pieces into the necessary parts of your file
system, and binary packages, which are available for systems that have a software package management
system, such as the Red Hat Package Manager (RPM) for Linux, and are the easiest to install.
Here’s a quick overview of the three methods:
Installation Method Advantages Disadvantages
Source Most flexible solution for
custom installations. Additional
tests and examples are included
in the source distribution
Needs to be compiled. Slightly
more difficult than the other
options. Harder to remove once
it’s been done
Binary (compiled) No need to mess around with
trying to compile the server.
Takes less time to install
Less flexible than doing an
installation from source
Binary RPMs Fastest and easiest installation
method. Very easy to uninstall
or upgrade later
Must be using an RPM-based
Linux distribution such as Red
Hat. Least flexible installation
method
An RPM Installation of PHP4
The version of Red Hat we’re using is actually called Fedora, because Red Hat has split off development
into two parts: Fedora and the enterprise version of Red Hat Linux. Currently, the Fedora site doesn’t
6