Installing PHP4 & Apache2.2 from source (Ubuntu 9.04 Jaunty Server)

I had to install PHP4 on a server in order to a test an application that will run under PHP4. Being a fan of Ubuntu, I chose Ubuntu 9.04 Jaunty Server edition as OS.

At first, I tried to install Apache using apt but subsequent compiling of PHP failed, perhaps due to different location of apache installation when using apt. Possibly, this can be fixed with some directives where to find certain Apache modules etc.

I then decided to install both latest Apache 2.2x and latest PHP4 (4.4.9) from scratch - compiling it. The process is quite simple as outlined on (php.net website):

  1. make yourself root
    sudo su
  2. download both, Apache 2.2, PHP4
  3. decompress as necessary
    gunzip filename.gz
    or
    tar -xvf filename.tar
  4. install “flex” and “bison”
    apt-get install flex
    apt-get install bison
  5. configure Apache
    cd httpxx
    ./configure --enable-so
  6. install make if missing
    apt-get install make
  7. compile Apache
    make
    make install
  8. install apache2-threaded-dev
    apt-get install apache2-threaded-dev
  9. Configure PHP
    ./configure --with-apxs2=/usr/bin/apxs2 --with-mysql
    Please note this is the minimal configuration including mysql libraries, if you need more modules, you need to add them.

    If config fails because of missing libicu, install it using:
    apt-get install libicu-dev
    If you get xml2-config error message, install:
    apt-get install libxml2-dev

  10. Compile PHP
    make
    make install
  11. Copy over default php.ini, amend as necessary and add handler for php files to Apache config file (if necessary).
  12. You can also modify default index page to include index.php.
  1. No comments yet.

You must be logged in to post a comment.

  1. No trackbacks yet.

SetPageWidth