PHP DevCenter

oreilly.comSafari Books Online.Conferences.

We've expanded our LAMP news coverage and improved our search! Search for all things LAMP across O'Reilly!

Search
Search Tips

advertisement

Listen Print Subscribe to PHP Subscribe to Newsletters
PHP Admin Basics

Basic Installation of PHP on a Unix System

11/17/2000

The configuration system that PHP uses for installation is one of those nice, simple things in life that makes it rosy. At first it might seem a little confusing, but it's really very easy. So let's dive right in.

To download PHP, visit the php.net download page and click the link under the heading "Complete Source Code."

The first thing to do after downloading and unpacking your source archive is to kick the tires a little bit.

You can unpack the archive using:

gunzip php-x.x.x.tar.gz;
tar xvf php-x.x.x.tar

(Substitute x.x.x for the actual version number of the php archive you downloaded.)

After which, you should see a directory called php-x.x.x, where x.x.x is the version number or some variation thereof. Then, cd into this directory and type:

./configure --help | more

to get a list of all available configuration options. The first few lines of output should look something like this:

Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print "checking..." messages
--version print the version of autoconf that created configure

Also this week:

Achieving Low-Latency Response Times Under Linux

LAMP Lighter: The Apache Toolbox

Exploring the /proc/net/ Directory

BSD Tricks: Linux Compatibility, the Hard Way

Before compiling PHP you must first decide whether you're going to install it as a CGI binary or as an Apache module. I'll discuss compiling as an Apache module, as the two are virtually identical.

Next you must decide what additional PHP modules you wish to have built at compile time. An example of these modules might be mCrypt or FTP. I'll use these two as examples, but there are many more available. A complete list of supported modules can be found in the PHP documentation or by executing the above configure command.

To configure PHP with the mCrypt and FTP modules built in, type the following command:

./configure --with-apache=/tmp/apache_1.3.12 --with-mcrypt --with-ftp

Here I use /tmp/apache_1.3.12 as an example. You should replace it with the actual location of your Apache source. The configuration script will now go through a series of checks to see what you have installed on your system. If something the compiler will need is missing, it will let you know of your grievous error and stop abruptly with an error like:

configure: error: Please reinstall libmcrypt - I cannot find mcrypt.h

This is the configuration system's way of telling you it loves you, but you only have twenty-four hours to save the earth. That, and it couldn't find the mCrypt libraries anywhere on your system. So, go download and install any necessary libraries.

Pages: 1, 2

Next Pagearrow




Tagged Articles

Be the first to post this article to del.icio.us

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

O'Reilly Media

©2009, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Academic Solutions
Authors
Contacts
Customer Service
Jobs
Newsletters
O'Reilly Labs
Press Room
Privacy Policy
RSS Feeds
Terms of Service
User Groups
Writing for O'Reilly
Content Archive
Business Technology
Computer Technology
Google
Microsoft
Mobile
Network
Operating System
Digital Photography
Programming
Software
Web
Web Design
More O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
O'Reilly FYI
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

Partner Sites
InsideRIA
java.net
O'Reilly Insights on Forbes.com