[freetds] php freetds version command
Daniel Fazekas
fdsubs at t-online.hu
Wed Mar 15 17:52:21 EST 2006
On Mar 15, 2006, at 22:29, ChaosMedia > WebDev wrote:
> i'd like to know if there's an undocumented php mssql (or other)
> function to print the current freetds version running for that php
> install..
You could enable TDSDUMP logging, the first line of which is the
FreeTDS version number.
For example, you could execute this in your shell if you got the CLI
version of PHP installed and properly configured:
TDSDUMP=stdout php -r 'mssql_connect();'
Then you'll see output such as:
23:20:51.615922 Starting log file for FreeTDS 0.63
on 2006-03-15 23:20:51 with debug level 99.
An alternative would be to check what is linked to what.
The mssql/sybase/sybase_ct php extensions, like all php extensions,
may be compiled in statically to the main php binary, or installed as
a shared library, which you'll then load somewhere dynamically, for
example in your php.ini file.
If it's linked in statically, you check the main php binary -- called
simply php in the CLI SAPI, or libphp4.so/libphp5.so for the Apache
SAPI.
In your case, I'm guessing it will be a shared library extension
instead.
Then you first figure out where the shared extensions are. You can
get it from a phpinfo() output:
php -i | grep extension_dir
Then in that directory, you'll find the mssql.so/sybase.so/
sybase_ct.so extension depending on which one you're using.
Finally you use ldd to get a list of what it's linked to (Mac OS X
users substitute otool -L in place of ldd):
ldd mssql.so
libsybdb.so.4 => /usr/local/lib/libsybdb.so.4 (0x4000c000)
libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
The libsybdb.so (mssql, sybase) or libct.so (sybase_ct) line is what
interests you here.
Now you know which library it is referencing, and can see for sure
whether it's the correct place and version that you expected it to be
using.
> Finally when i first installed freetds 0.63 from the source i noticed
> the "interfaces" config file wasn't copied to the config directory
> so i
> was wondering if that file was removed in latest freetds versions..
You don't need that, just stick to freetds.conf.
--
fds
More information about the FreeTDS
mailing list