SHARE
Facebook X Pinterest WhatsApp

PHP on Apache: The Definitive Installation Guide Page 6

Written By
thumbnail Ken Coar
Ken Coar
Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



To build Apache from source (e.g., your Linux distribution package
didn’t provide the pieces necessary to add PHP), use the following commands as
a quick-start. Download the latest released version of the Apache tarball and
unpack it into a working directory. The top-level directory will then be
./apache-1.3, which matches assumption #1 described earlier.

    % cd ./apache-1.3
    % env CC=gcc CFLAGS="-O2 -Wall" 
    > ./configure --enable-shared=max --enable-module=most 
    > --with-layout=Apache --prefix=/usr/local/web/apache 
    > --with-port=80
    Configuring for Apache, Version 1.3.10-dev
     + using installation path layout: Apache (config.layout)
    Creating Makefile
    Creating Configuration.apaci in src
        [more configuration output]
    % make
        [lots of compilation output]
    % make install
        [lots more output describing file placement]
    % /usr/local/web/apache/bin/apachectl start

If there are no errors, you should now have a working Apache installation in
the location that matches assumption #2 described earlier. It was written to
work with dynamic modules rather than static ones, so build PHP as a dynamic
module.

It’s far beyond the scope of this article to give any more information about
building Apache; it is about PHP, after all. If you’d like to see an
article in this column about the details of building Apache, let me know.

Appendix B: Apache Source Components Provided by Linux Distributions

The following table shows the paths to the apxs and Apache
source tree as supplied by the packages included with various Linux
distributions. Note: Some of this information is inferential only,
determined by examining the distribution kits rather than actually installing
them. As a result, it may be inaccurate in some respects.

Distribution Version of Apache supplied Value for --with-apxs Value for --with-apache
Caldera OpenLinux 2.3 1.3.4 [note 1]
Corel 1.3.3 /usr/sbin/apxs [note 1]
Debian GNU/Linux 2.1 1.3.3 /usr/sbin/apxs [note 1]
Linux-Mandrake 6.1 1.3.9 /usr/sbin/apxs [note 2] [note 1]
Linux Pro 5.4 1.1.3, 1.2.5 [note 1]
Red Hat Linux 6.1 1.3.9 /usr/sbin/apxs [notes 2, 3] [note 1]
Slackware 7.0 1.3.9 /var/lib/apache/sbin/apxs /var/lib/apache
S.u.S.E. Linux 6.2 1.3.6 /usr/sbin/apxs [note 1]
TurboLinux 3.6 1.3.6 /usr/sbin/apxs [note 2] [note 1]

Notes


  1. This article was originally published on Aug 9, 2000

    Page
    6 of
    7

    Previous Page   1

    2

    3

    4

    5

    6

    7

    Next Page  

    Acceptable Use Policy Terms of Service |
    About Us |
    Privacy Notice |
    Contact Us |
    Advertise |
    Sitemap |
    California – Do Not Sell My Info

    Advertiser Disclosure: 

    Thanks for your registration, follow us on our social networks to keep up-to-date
thumbnail Ken Coar

Ken Coar is a ServerWatch contributor.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.