470,855 Members | 1,251 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

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

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
0 2664

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by lawrence | last post: by
reply views Thread by Ruud vd Velden | last post: by
12 posts views Thread by JJ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.