views:

478

answers:

3

Hello, I am running a wiki server for my group at work and recently moved it to a Fedora 8 OS. Everything works great except that an extension I wrote that contacts an MsSql server fails because the function mssql_connect is not there.

On my old server I used "Free TDS" (with ./configure --prefix=/usr/local/freetds --enable-msdblib) and built PHP with:
./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mssql=/usr/local/freetds \
--enable-safe-mode \
--enable-ftp \
--enable-inline-optimization \
--enable-magic-quotes --enable-xml \
--with-gd \
--with-zlib-dir=/usr/lib \
--with-jpeg-dir=/usr/local/lib

Is there a way I can easily rebuild PHP with the "--with-mssql=/usr/local/freetds" configuration on Fedora? I would like to use yum to do this, but I don't see how. More to the point, I would like to avoid having to build everything from scratch. It's not that I don't know how, I would just like to avoid it.

Thanks for your your advice,
~Eric

+1  A: 

Please post output from your build. Is it failing because /usr/local/freetds is missing?

If it is, can you use yum to install it, or download and compile freetds yourself. I haven't done this but it'll be something like this...

  1. Open shell and navigate to directory with freetds archive.
  2. Execute tar zxvf to extract.
  3. Execute cd
  4. Run ./configure for the freetds build
  5. Run make, (sudo) make install

Then find where freetds is installed and pass that folder to the ./configure command for PHP.

BrianLy
I was hoping to not do this and tell yum how to find freetds when installing PHP.
EToreo
A: 

So, the answer to adding mssql is as easy as "yum install php-mssql". Fixed my problem without any messing around. FreeTDS is installed an easily configurable. Thanks everyone who tried to answer or left a comment.

EToreo
A: 

Get SQL Server Driver for PHP, I don't think that you have to rebuild php to use this driver. I suggest you to use vendor's driver.

Sharique