Installing PHP for Linux and Apache

In this section, we will look at one way of installing PHP with Apache on Linux. The process is more or less the same for any Unix operating system. You might be able to find prebuilt versions of PHP for your system, which are simple to install.

Compiling PHP, though, gives you greater control over the features built in to your binary.

Before you install, you should ensure that you are logged in to your system as the root user. If you are not allowed access to your system’s root account, you might need to ask your system administrator to install PHP for you.

There are two ways of compiling an Apache PHP module. You can either recompile Apache, statically linking PHP into it, or you can compile PHP as a dynamic ...

Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.