Skip to Content.
Sympa Menu

freetds - [freetds] anyone using freetds with PHP ?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "John P. Looney" <valen AT tuatha.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] anyone using freetds with PHP ?
  • Date: Thu, 15 Jan 2004 12:20:43 +0000

I need to talk to an SQL server DB with php, so I compiled up my own PHP
with mssql support. It worked fine yesterday, but now core dumps a lot;

(gdb) bt
#0 0xb72d3980 in _int_malloc () from /lib/tls/libc.so.6
#1 0xb72d2b0d in malloc () from /lib/tls/libc.so.6
#2 0xb6a07c54 in _emalloc (size=1) at
/root/php/php-4.3.4/Zend/zend_alloc.c:158
#3 0xb6a0806c in _estrndup (s=0x825a688 "U ", length=2) at
/root/php/php-4.3.4/Zend/zend_alloc.c:381
#4 0xb6957c8d in php_mssql_get_column_content_with_type
(mssql_ptr=0x82651b4, offset=14, result=0x825aef8, column_type=2) at
/root/php/php-4.3.4/ext/mssql/php_mssql.c:792
#5 0xb6958541 in _mssql_fetch_batch (mssql_ptr=0x82651b4, result=0x8265cb4,
retvalue=-1) at /root/php/php-4.3.4/ext/mssql/php_mssql.c:1052
#6 0xb6958a74 in zif_mssql_query (ht=-1220970720, return_value=0x8259d84,
this_ptr=0x0, return_value_used=1) at
/root/php/php-4.3.4/ext/mssql/php_mssql.c:1170
#7 0xb7037542 in zend_assign_to_variable_reference () from
/usr/local/Zend/lib/Optimizer-2.1.0/php-4.3.x/ZendOptimizer.so
#8 0x00000003 in ?? ()
#9 0x08259d84 in ?? ()

The only thing that worries me is that I changed the PHP code slightly,
to get it to compile:

/root/php/php-4.3.4/ext/mssql/php_mssql.c: In function `zm_activate_mssql':
/root/php/php-4.3.4/ext/mssql/php_mssql.c:338: `SHORT' undeclared (first use
in this function)
/root/php/php-4.3.4/ext/mssql/php_mssql.c:338: (Each undeclared identifier is
reported only once
/root/php/php-4.3.4/ext/mssql/php_mssql.c:338: for each function it appears
in.)

I changed:
dbsetmaxprocs((SHORT)MS_SQL_G(max_procs));
to
dbsetmaxprocs((int)MS_SQL_G(max_procs));
And it did compile. Can anyone help ?

John




Archive powered by MHonArc 2.6.24.

Top of Page