4. mod_php and its prerequisites

4.1. What is mod_php

Quoting www.php.net

PHP is a server-side, cross-platform, HTML embedded scripting language.

In the beginning it was just a simple guestbook-processor, and it was growing and growing Since Version 3 it is really powerful Webdevelopment-language

From the authors point of view:

Since Version 4 its capable and robust for enterprise Webapplications. It powerful, supports almost all important Databases natively, and other throught ODBC. It a few times faster that ASP on M$-Systems on the same Hardware.

There are other extensions available like apc which speeds up processing about 50-400% (depends on the php-code you wrote)

4.2. Prerequisites

Depending on your needs there are some software to install first. One already installed Software according this document is MySQL, because its needed by mod_auth_mysql.

4.2.1. IMAP client

4.2.1.1. What is IMAP client

IMAP means "Internet Mail Application Protocol" and is a substitute for the POP protocol. It allows you to keep all Mails in different folders on the server, which (should) be backed up - never lose important Email, because your local Harddrive crashes

4.2.2. Download the source

Origin-Site:

Origin-Site: http://www.washington.edu/imap/

4.2.3. Building and installing


cd /usr/local

tar -xvfz imap.tar.Z

cd imap

make slx SSLTYPE=unix



Notice:

imap.tar.Z is usually a symlink to the latest release, today its linked to imap-2001a.tar.Z

If you dont need SSL-Support, remove the "SSLTYPE=unix" behind the make command

4.2.4. Postgres

4.2.4.1. What is Postgres

Postgres is a very Powerful and fast Database

Its like MySQL wonderful for Webapplications, but from my Point of view, not such comfortable to handle like MySQL. If your Webapplication writes a lot of Data, or you need proofed transaction-capabilities, Postgres is your friend

4.2.4.2. Download the source

Origin-Site: http://www.postgresql.org (Select a mirror close to you)

4.2.4.3. Building and installing


cd /usr/local

tar -xvzf postgresql-7.1.3.tar.gz

cd postgresql-7.1.3

./configure \
--with-perl \
--with-odbc \

make
make install

echo /usr/local/pgsql/lib >> /etc/ld.so.conf

ldconfig

4.2.5. pdflib

4.2.5.1. What is pdflib

Quoting www.pdflib.com

PDFlib: A library for generating PDF on the fly PDFlib is the premier software component if you want to generate PDF on your server, convert text and graphics, or implement PDF output in your own products.

This is a commercial Procduct! read the licence carefully to see if you need a commercial licence or not!

4.2.5.2. Download the source

Origin-Site: http://www.pdflib.com/pdflib/download/pdflib-4.0.1.tar.gz

4.2.5.3. Building and installing


cd /usr/local/
tar -xvzf pdflib-4.0.1.tar.gz

cd pdflib-4.0.1

./configure --enable-shared-pdflib --enable-cxx

make
make install

ldconfig

4.2.6. gettext

4.2.6.1. What is gettext

gettext is a library for interneationalization, and needed by php

4.2.6.2. Download the source

Origin-Site: ftp://ftp.gnu.org/gnu/gettext (select a mirror close to you)

4.2.6.3. Building and installing


cd /usr/local

tar -xvzf gettext-0.10.40.tar.gz

cd gettext-0.10.40

./configure

make
make check
make install

ldconfig

4.2.7. zlib

4.2.7.1. What is zlib

zlib is a lossless data-compression library for use on virtually any computer hardware and operating system

4.2.7.3. Building and installing


cd /usr/local

tar -xvzf zlib.tar.gz

cd zlib-1.1.3/

./configure

make
make check
make install

ldconfig

4.3. Builing and installing PHP4


cd /usr/local

tar -xvzf php-4.1.0.tar.gz

cd php-4.1.0


./configure \
--with-apxs=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-pgsql=/usr/local/pgsql \
--enable-track-vars \
--with-openssl=/usr/local/ssl \
--with-imap-ssl=/usr/local/imap-2001a \
--with-gd --with-ldap \
--enable-ftp \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-pdflib=/usr/local \
--with-gettext \
--with-mm=/usr/local/mm-1.1.3 \
--with-jpeg-dir=/usr/lib \
--with-zlib-dir=/usr/local \

make
make install

Copy the sample php.ini to /usr/local/lib/php.ini


cp /usr/local/php-4.1.0/php.ini-dist /usr/local/lib/php.ini

uncomment (remove the # at begin of line) the following lines in /usr/local/apache/conf/httpd.conf


AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

you may wish to add the following:


AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3

Restart apache by issuing the following command:


/usr/local/apache/bin/apachectl restart