recompiling php to use mssql extension

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
manouche
Forum Newbie
Posts: 2
Joined: Wed Jun 16, 2010 12:55 pm

recompiling php to use mssql extension

Post by manouche »

Hello all,

I have a Linux box with Redhat ES 3, using PHP 4.3.2. It will all be upgraded in another 6 months, but I need to get this problem resolved before then.

I want to use php to query an SQL Server 2005 on a Windows server. I have freetds installed and configured and can do command line querying.

I added the line: extension=mssql.so to the php.ini file.

Now, I believe I need to recompile php to use the extension. My question is whether I need to do a recompile on the existing install, or can I install it in another area and just move the mssql.so file into the current install?

Also, php was installed as an rpm. If I want to recompile, I assume I need a source rpm (version 4.3.2), but then how do I apply the current configuration information. I have all that information, collected from the phpinfo.php file. I would add ghis:

--with-mssql=/usr/local so that it knows about freetds

So, any tips would be great. Can I use an rpm to do what I want?
User avatar
liljester
Forum Contributor
Posts: 400
Joined: Tue May 20, 2003 4:49 pm

Re: recompiling php to use mssql extension

Post by liljester »

ive never been successful getting php to talk to mssql from linux. but to be honest, i really didnt try very hard because its a pretty easy feat with a windows server :P
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: recompiling php to use mssql extension

Post by Doug G »

You need to install freeTDS, then set up a ODBC connection to the mssql server in freeTDS. Then you should be able to connect using php_odbc.
Post Reply