php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8126 [PATCH] undefined symbol: dbopen
Submitted: 2000-12-05 14:13 UTC Modified: 2001-05-02 15:53 UTC
From: raz at harbourfront dot on dot ca Assigned: vlad (profile)
Status: Closed Package: Sybase (dblib) related
PHP Version: 4.0.3pl1 OS: redhat 7
Private report: No CVE-ID: None
 [2000-12-05 14:13 UTC] raz at harbourfront dot on dot 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-11 14:11 UTC] joey@php.net
Reclassify. --with-sybase is dblib, not ctlib.
 [2000-12-11 14:11 UTC] joey@php.net
Reclassify. --with-sybase is dblib, not ctlib.
 [2001-05-01 19:40 UTC] 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;


 [2001-05-02 15:53 UTC] vlad@php.net
Fixed in CVS

Vlad
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC