[freetds] Using FreeTDS shared libraries

L J Bayuk lbayuk at mindspring.com
Wed Mar 19 22:21:18 EST 2003


James K. Lowden wrote:
> 
> On Wed, 19 Mar 2003 15:06:02 +0100, Klaus-Michael Köhler
> <Klaus-Michael.Koehler at siemens.com> wrote:
> 
> > I got the FreeTDS archive (version 0.61), compiled it and installed it.
> > Is there any possibility to activate the libraries WITHOUT recompiling 
> > PHP and Apache? [At the moment we're using the precompiled binaries of 
> > the distribution.]
> 
> I don't see how it would be possible to use FreeTDS without compilation. 
> Where would the function definitions come from, the enumerated types, all
> the stuff in, say, sybdb.h?  
> 
> I don't know about Apache, but PHP definitely has to be recompiled before
> it can know what it needs to use FreeTDS.  

You can do it by compiling just the PHP sybase_ct extension; no need to
recompile all of PHP. (Provided your current PHP either does not have
sybase_ct built in, or has it as a loadable extension.)  The process is
described in the PHP source file README.SELF-CONTAINED-EXTENSIONS.
You just need the source directory ext/sybase_ct from PHP, which you can
copy anywhere you want, and a working PHP installation.

Here is an example (but this assumes my install paths):
   $ cp -rp .../php-4.3.0/ext/sybase_ct sybase_ct
   $ cd sybase_ct
   $ /opt/php/bin/phpize
Your directory "sybase_ct" is now a "self contained extension".
To build it:
  ./configure --with-php-config=/opt/php/bin/php-config \
              --with-sybase-ct=shared,/opt/freetds
  make
  make install
You have now installed "sybase_ct.so" in your PHP loadable extensions
directory. Put "extension=sybase_ct.so" in php.ini (assuming you want
it loaded by default), and then "apachectl graceful" to restart.


More information about the FreeTDS mailing list