Bug #8126 Updated: [PATCH] undefined symbol: dbopen

From: Date: Wed, 02 May 2001 19:53:54 +0000
Subject: Bug #8126 Updated: [PATCH] undefined symbol: dbopen
Groups: php.dev 
Request: Send a blank email to php-dev+get-53428@lists.php.net to get a copy of this message
ID: 8126 Updated by: vlad Reported By: raz@harbourfront.on.ca Old-Status: Open Status: Closed Bug Type: Sybase (dblib) related PHP Version: 4.0.3pl1 Assigned To: vlad Comments: Fixed in CVS Vlad Previous Comments: --------------------------------------------------------------------------- [2001-05-01 19:40:04] vlad@php.net Patch for the problem below. Please, review. Apparently, dbopen() might or might not exist, depending on how you install FreeTDS. Sometimes FreeTDS provides you with tdsdbopen() instead. The patch checks, if tdsdbopen() is available (a config.m4 modification), and, if yes, uses it. If not, it falls back to using dbopen(). Does anyone have objections to the way I implemented it (it's kinda crude, with #define, but I think this is the cleanest I can get). If someone has objections, please speak now. If nobody has objections, someone with enough karma, please apply the patch (or give me karma and I'll apply it myself). diff -urN php-4.0.5-tdsbroken/ext/sybase/config.m4 php-4.0.5/ext/sybase/config.m4 --- php-4.0.5-tdsbroken/ext/sybase/config.m4 Mon May 1 21:27:02 2000 +++ php-4.0.5/ext/sybase/config.m4 Tue May 1 16:28:14 2001 @@ -21,4 +21,8 @@ AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ]) ]) AC_DEFINE(HAVE_SYBASE,1,[ ]) + AC_CHECK_LIB(sybdb, tdsdbopen, + [ AC_DEFINE(PHP_SYBASE_DBOPEN,tdsdbopen,[ ]) + AC_DEFINE(DBMFIX,1,[ ]) ], + [ AC_DEFINE(PHP_SYBASE_DBOPEN,dbopen,[ ]) ]) fi diff -urN php-4.0.5-tdsbroken/ext/sybase/php_sybase_db.c php-4.0.5/ext/sybase/php_sybase_db.c --- php-4.0.5-tdsbroken/ext/sybase/php_sybase_db.c Sun Feb 25 22:07:24 2001 +++ php-4.0.5/ext/sybase/php_sybase_db.c Tue May 1 15:42:54 2001 @@ -379,7 +379,7 @@ RETURN_FALSE; } /* create the link */ - if ((sybase.link=dbopen(sybase.login,host))==FAIL) { + if ((sybase.link=PHP_SYBASE_DBOPEN(sybase.login,host))==FAIL) { /*php_error(E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ efree(hashed_details); dbloginfree(sybase.login); @@ -415,7 +415,7 @@ sybase_ptr = (sybase_link *) le->ptr; /* test that the link hasn't died */ if (DBDEAD(sybase_ptr->link)==TRUE) { - if ((sybase_ptr->link=dbopen(sybase_ptr->login,host))==FAIL) { + if ((sybase_ptr->link=PHP_SYBASE_DBOPEN(sybase_ptr->login,host))==FAIL) { /*php_error(E_WARNING,"Sybase: Link to server lost, unable to reconnect");*/ zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); efree(hashed_details); @@ -462,7 +462,7 @@ RETURN_FALSE; } - if ((sybase.link=dbopen(sybase.login,host))==NULL) { + if ((sybase.link=PHP_SYBASE_DBOPEN(sybase.login,host))==NULL) { /*php_error(E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ efree(hashed_details); RETURN_FALSE; --------------------------------------------------------------------------- [2000-12-11 14:11:56] joey@php.net Reclassify. --with-sybase is dblib, not ctlib. --------------------------------------------------------------------------- [2000-12-11 14:11:44] joey@php.net Reclassify. --with-sybase is dblib, not ctlib. --------------------------------------------------------------------------- [2000-12-05 14:13:34] raz@harbourfront.on.ca when i load apache, i get : cannot load libphp4.so into server: undefiend symbol: dbopen httpd could not be started. I have apache 1.3.14 and php 4.0.3pl1. apache configure.. ./configure --prefix=/www --enable-module=so php configure.. ./configure --with-apxs=/www/bin/apxs --with-sybase=/usr/local/freetds I have freetds 0.51. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=8126&edit=2

« previous php.dev (#53428) next »