Most recent edit on 2006-12-12 12:28:08 by DougBarry []
Additions:
Deletions:
Oldest known version of this page was edited on 2006-12-12 12:27:54 by DougBarry []
Page view:
Getting MSSQL to work with PHP5 on FC4, needs some skills. I got the latest
FreeTDS stables and PHP5 stables.
Compile and install
FreeTDS
unpack the source distribution if necessary
> ./configure --with-tdsver=4.2
You also might have to state the location of freetds: --prefix=/usr/local/freetds
Note: The
FreeTDS FAQ seems to suggest that --with-tdsver=7.0 might be a good choice for connecting to an MS SQL Server 7. Actually, many people report problems for TDSVER=70, and I didn't get it to work, either. Using TDSVER=42 should work just fine under most circumstances.
Other configure options would be --enable-msdblib (it appears to work fine for me without that one - I would be interested if anyone could enlighten me as to when this is actually needed) and --enable-dbmfix (read the FAQ on that one! It didn't make any difference for me, either).
> make
> su
> make install
assume that the installation location for
FreeTDS is the default /usr/local/freetds (you will need root access to install to that location).
Set environment variables
The SYBASE environment variable will need to be set as well as LD_LIBRARY_PATH extended.
For a bash shell, this looks as follows:
> SYBASE=/usr/local/freetds
> LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$SYBASE/lib
> export SYBASE LD_LIBRARY_PATH
Now its time to configure PHP5
I decided i wanted a few things in with this, like mbstring for compitibility, gd (meaning i have to get the libpng-devel and libjpeg-devel packages, use "yum install libpng-devel libpng-devel") and a few other bits for security.
unpack the source distribution if necessary
> ./configure <NORMAL OPTIONS HERE> --with-sybase=/usr/local/freetds --with-mssql
My script for hal was
./configure --prefix=/usr/share --datadir=/usr/share/php \
--bindir=/usr/bin \
--with-apxs2 \
--libdir=/usr/share --includedir=/usr/include \
--bindir=/usr/bin \
--with-config-file-path=/etc/ \
--enable-mbstring \
--enable-mbregex \
--with-mysql \
--with-gd --enable-gd-imgstrttf --enable-gd-native-ttf \
--with-zlib-dir=/usr/lib \
--with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib \
--with-tiff-dir=/usr/lib --with-ttf-dir=/usr/lib \
--with-freetype-dir=/usr/lib \
--enable-ftp \
--enable-memory-limit \
--enable-safe-mode \
--enable-bcmath \
--enable-calendar \
--enable-ctype --with-ftp \
--with-bz2 \
--enable-inline-optimization \
--with-iconv \
--with-sybase=/usr/local/freetds \
--with-mssql
You also might have to state the location of php, e.g. --prefix=/usr/local/php
--with-apsx2 is for apache2, its just "--with-apsx" for apache1. It is unlikely you will have to specify the location, i found that when i did, it didnt work well.
now you need to make php
Stop Apache
> /sbin/service httpd stop
Install php
Restart Apache
> /sbin/service httpd start
Tthis should over write your current php general installation.
test it :)
CategoryHowTo