Accessing MS SQL Server from Ubuntu with PHP/Apache

Alf-Ivar Holm alfh at
Mon Apr 3 13:41:31 UTC 2006

Chanchao <custom at> writes:

> I'm  currently trying to configure things so I can use an MS SQL (or
> MSDE) database with PHP.  I note that the 'FreeTDS' client is in the
> supported repositories. Most PHP 'how-to' guides I find talk about
> compiling FreeTDS manually, and even compiling PHP5 with particular
> options.
> Is anyone reading this who got this to work on Ubuntu, and did it
> require (re)compiling things?  

Have it working straight out of the repositories in Dapper, but we use
unixODBC in production (for historical reasons - moved to Warty from
Red Hat 8, where, according to my notes, support for the mssql_*
functions where not compiled into the RPM version of PHP).

> Or just apt-get php and freetds and updating some configuration
> files?

As far as I can see the packages libct3 and tdsodbc are used, the
latter is used with unixODBC.  

Note: /usr/share/libct3/freetds.conf doesn't seem to be read, use
/etc/freetds/freetds.conf instead.  (I used a softlink from the latter
to the first, to make it easier to administrate.)

> I'm not having any luck so far. 

What did you try, and what went wrong?


More information about the ubuntu-users mailing list