Whole document tree
    

Whole document tree

mod_php and its prerequisites

4. mod_php and its prerequisites

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.3. php>


cd /usr/local

tar -xvzf php-4.1.2.tar.gz

cd php-4.1.2


./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

After installing your httpd.conf is modified by axps. It should now look as follows:


<IfDefine SSL>
LoadModule ssl_module         libexec/libssl.so
LoadModule php4_module        libexec/libphp4.so
</IfDefine>

If you compiled Apache with mod_ssl then the php-module will only be loaded when staring Apache with ssl (apachectl startssl). If you will start Apache without ssl support (but compiled like described in this document) you need to change this:


<IfDefine SSL>
LoadModule ssl_module         libexec/libssl.so
</IfDefine>
LoadModule php4_module        libexec/libphp4.so

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


cp /usr/local/php-4.1.2/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

Apache 1.3.23 default httpd.conf does lack of this entries. You have to add them instead of uncommenting


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