[KLUG Members] PHP and Mysql defaults

Big M members@kalamazoolinux.org
Thu, 11 Oct 2001 21:01:59 -0700 (PDT)


> Hello,
> 
> On a default install of Slackware does PHP4 come configured with 
MySql
> support?
> 
> I ran into a major road block trying to install Horde and IMP because

PHP
> 4 on my box does not support MySql .... which really sucks.
> 
> I tried recompiling PHP 4 --with-mysql --with-apxs,  I got in even 
more
> trouble .... PHP 4 does not work at all
> 
> Would I be better off ... re-installing RH 7 without PHP 4 ... and
> compiling PHP 4 after the OS is installed ....?
> 
> Thank You
> Rich
> 

I have had no problems compiling PHP 4 on RH 7 (that is what is on my
server at Rackspace). At home, I run Slackware.

I have never messed with apxs since I had problems with that early on.
I usually recompile everything when Apache comes out with new versions.
I have followed the instructions that are given on mod_ssl's site, and
they seem to work quite well.

Here is how I do it.

Prerequisites
_____________

To use mod_ssl I use the following packages:

   o  Package:      Apache 
      Version:      1.3.x
      Description:  The Apache Group HTTP Server
      Reason:       The webserver base package on which all is based
      Homepage:     http://www.apache.org/
      Distribution: http://www.apache.org/dist/
      Tarball:      apache_1.3.x.tar.gz

   o  Package:      mod_ssl
      Version:      2.8.x
      Description:  The Apache Interface to OpenSSL
      Reason:       The interface module for Apache
      Homepage:     http://www.modssl.org/
      Distribution: ftp://ftp.modssl.org/source/
      Tarball:      mod_ssl-2.8.x-1.3.x.tar.gz

   o  Package:      OpenSSL
      Version:      0.9.x
      Description:  The Open Source Toolkit for SSL/TLS
      Reason:       The library which implements SSL/TLS
      Homepage:     http://www.openssl.org/
      Distribution: ftp://ftp.openssl.org/source/
      Tarball:      openssl-0.9.x.tar.gz

   o  Package:      MM
      Version:      1.1.x
      Description:  Shared Memory Library
      Reason:       The portable library for shared memory 
                    in Apache/EAPI
      Homepage:     http://www.engelschall.com/sw/mm/
      Distribution: http://www.engelschall.com/sw/mm/
      Tarball:      mm-1.1.x.tar.gz

   o  Package:      GZip
      Version:      1.2.4
      Description:  The compression utility
      Reason:       To unpack the above tarballs
      Homepage:     http://www.gnu.org/
      Distribution: ftp://ftp.gnu.org/pub/gnu/
      Tarball:      gzip-1.2.4.tar.Z
 
   o  Package:      Perl
      Version:      5.6.0
      Description:  The Practical Extraction and Reporting Language
      Reason:       To configure OpenSSL
      Homepage:     http://www.perl.com/
      Distribution: http://www.cpan.org/src/5.0/
      Tarball:      perl-5.6.0.tar.gz

Download all the packages into one directory; also download
into the same directory any packages you want to include in
php, and compile them as needed.

gzip -d -c apache_1.3.x.tar.gz | tar xvf -
gzip -d -c mod_ssl-2.8.x-1.3.x.tar.gz | tar xvf -
gzip -d -c openssl-0.9.x.tar.gz | tar xvf -
gzip -d -c mm-1.1.x.tar.gz | tar xvf -
gzip -d -c php-4.0.x | tar xvf -

ln -s apache_1.3.x apache
ln -s mod_ssl-2.8.x-1.3.x mod_ssl
ln -s openssl-0.9.x openssl
ln -s mm-1.1.x mm
ln -s php-4.0.x php

cd openssl
sh config
make
make test

cd ../mm
./configure --disable-shared
make

cd ../mod_ssl
./configure \
--with-apache=../apache \
--with-crt=/usr/local/apache/conf/ssl.crt/server.crt \   (optional)
--with-key=/usr/local/apache/conf/ssl.key/server.key     (optional)

cd ../apache
./configure --prefix=/usr/local/apache (a pre-configure php needs)

cd ../php
./configure \
--with-mysql=/usr/local/mysql \
--with-pgsql=/usr/local/pgsql \
--with-apache=../apache \
--enable-magic-quotes \
--with-openssl=/usr/local/ssl \
--enable-ftp \
--with-mm \
--enable-trans-sid \
--enable-inline-optimization \
--enable-memory-limit \
--with-curl=/usr/local \
--enable-sockets \
--enable-shmop \
--enable-sysvsem \
--enable-sysvshm \
--with-pspell=/usr/local \
--with-gd=/usr \
--enable-gd-native-tt \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-ttf=no \
--with-freetype-dir=/usr/local \
--enable-freetype-4bit-antialias-hack \
--with-mnogosearch
make
make install
cp php.ini-dist /usr/local/lib/php.ini

cd ../apache
EAPI_MM="../mm" \
SSL_BASE="../openssl" \
./configure \
--with-layout=Apache \
--enable-module=ssl \
--enable-module=proxy \     (optional, add modules you want)
--prefix=/usr/local/apache \
--disable-rule=SSL_COMPAT \
--enable-rule=SSL_SDBM \
--activate-module=src/modules/php4/libphp4.a
make
make certificate  (if you don't already have one)
make install

cd /usr/local/apache/conf

Edit your httpd.conf or srm.conf file and add: 
   AddType application/x-httpd-php .php


Try out Apache without SSL (only HTTP protocol possible):

/usr/local/apache/bin/apachectl start
browse to your site with an http protocol
/usr/local/apache/bin/apachectl stop

Try out Apache with SSL (both HTTP and HTTPS protocol possible):

/usr/local/apache/bin/apachectl startssl
browse to your site with an http protocol
browse to your site with an https protocol
/usr/local/apache/bin/apachectl stop


=====
http://www.dot2date.com
the way dating was meant to be
fast. friendly. fun.

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com