Skip to Content.
Sympa Menu

freetds - Re: [freetds] php freetds version command

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ChaosMedia > WebDev" <webdev AT chaosmedia.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] php freetds version command
  • Date: Thu, 16 Mar 2006 12:23:40 +0100

hi,

thx for your answers unfortunately i'm not sure i actually found which version is running when i call the php functions

the TDSDUMP comand outputs the following data :

#TDSDUMP=stdout php -r 'mssql_connect();'
Starting log file with debug level 99.
2006-03-16 11:56:12.459217 iconv will convert client-side data to the "ISO-8859-1" character set
2006-03-16 11:56:12.467707 IP address pointer is NULL
2006-03-16 11:56:12.468146 Server SYBASE not found!
2006-03-16 11:56:12.469082 leaving ct_connect() returning 0

which is not very usefull as you can see.

following the ldd info i found out that the sybase_ct.so extension installed by that debian package was linked to
/usr/lib/libct.so.1 which is also installed by the package and so is probably the 0.61 version as specified in the libct1 package version

the source install produces a /usr/lib/libct.so.3 link to another binary, so i modified the /usr/lib/libct.so.1 link to make it point to the same binary as the /usr/lib/libct.so.3 link..

the the above TDSDUMP shell command outputs the following :

#TDSDUMP=stdout php -r 'mssql_connect();'
12:02:37.497223 Starting log file for FreeTDS 0.63
on 2006-03-16 12:02:37 with debug level 99.
12:02:37.505925 names for ISO-8859-1: ISO-8859-1
12:02:37.506361 names for UTF-8: UTF-8
12:02:37.506486 names for UCS-2LE: UCS-2LE
12:02:37.506669 names for UCS-2BE: UCS-2BE
12:02:37.506800 iconv to convert client-side data to the "ISO-8859-1" character set
12:02:37.508054 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
12:02:37.508272 IP address pointer is NULL

so i guess that php is now using my freetds 0.63 source install, but i was wondering if it was okay to do that or if that sybase_ct.so extension is only supposed to be used with the 0.61 freetds version provided in the original package..

So far my quick and dirty php tests using mssql functions still work with that new /usr/lib/libct.so.3 link but my guess is that it's not the proper way to install that php sybase_ct.so extension with freetds.. or is 0.61-0.63 compatible "enough" ?


Finally as you mentionned the various extensions available ">Then in that directory, you'll find the mssql.so/sybase.so/sybase_ct.so extension depending on which one you're using.", i was wondering what were the differences between them and if any which one should i consider to be the correct choice for my php use..
As a matter of fact i didn't really give it any thoughts and simply found that libct1 package available with debian that would give me access php MS SQL functions so i installed it but maybe another choice would have been ore appropriate ?

thx again,

webdev


Daniel Fazekas wrote:

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.






Archive powered by MHonArc 2.6.24.

Top of Page