By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

Need a database connector in PHP? Might not need to recompile.

P: n/a
I just found out from someone named Frank M. Kromann in one of the
other PHP forum websites that I don't have to recompile PHP on Linux
in order to add a database connector. I've been pulling my hair out on
this issue for several days now, so I wish to publicly thank Frank M.
Kromann, whereever he is. He didn't leave a valid reply email to me,
but he's alright in my book.

Let's say you have a beautiful Linux and PHP install. Everything is
working just right for you with PostgreSQL and MySQL, and now you have
some request from management to connect something like MSSQL, but you
find out that your install of Linux doesn't come with that connector.
My install, RH9, didn't. I had already written several pages of code
with my PHP, and I didn't want to risk it by reinstalling PHP and
Apache.

So, I got FreeTDS downloaded, installed properly, and connected via
its tsql test tool (/usr/bin/tsql) to my MS SQL Servers. Now all I had
to do was make Apache and PHP recognize it.

Frank said that all I need to do is download the PHP source, then do:

../configure --with-mssql,shared
make
DO NOT DO MAKE INSTALL<<<


This creates an mssql.so file, he said. Then, he said to copy this to
the PHP extension dir. To find out where that is, just look for
mysql.so or pgsql.so on your hard drive if you already have PHP
connecting to MySQL or PostgreSQL. Or, look for imap.so.

Next, he said I have either the choice of editing my PHP.INI file, or
use the dl() function at the top of a page in order to mount this .so
file when I need it, making the mssql_* API available within PHP.

And that's it. Now all I have to do is test his process out. I'm going
to need to get the source for PHP version 4.2.2 (that's what I have
and rely on right now with RH9)...stay tuned...
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.