php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4704 PHP crashes although ODBC appears to work occasionally
Submitted: 2000-05-30 20:35 UTC Modified: 2000-06-20 17:11 UTC
From: cnewbill at onewest dot net Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.0 Release OS: Redhat Linux 6.2
Private report: No CVE-ID: None
 [2000-05-30 20:35 UTC] cnewbill at onewest dot net
There are alot of SQL related compiler warnings when compiling PHP as follows

./configure --with-mysql --enable-trans-sid --enable-track-vars --enable-track-errors --with-esoob --with-apxs=/home/cnewbill/testapache/bin/apxs

These warnings appear whether I compile as CGI or static Apache Module.  They occur for virtually every ODBC function so I will only include a couple lines since they are all the same.

php_odbc.c: In function `_free_odbc_result':
php_odbc.c:158: warning: passing arg 1 of `SQLFreeStmt' makes integer from pointer without a cast
php_odbc.c: In function `_close_odbc_conn':
php_odbc.c:177: warning: passing arg 1 of `SQLDisconnect' makes integer from pointer without a cast

I am using EasySoft OOB and the bundled unixODBC driver manager. 

(gdb) bt
#0  0x40293ca0 in ?? ()
#1  0x401619d1 in __libc_start_main () at ../sysdeps/generic/libc-start.c:92

One note I am having better luck with PHP4 as a DSO. 

Example script

<?

$conn_id = odbc_connect("onewest","*******","******")

if ($conn_id == "") {
  print "Could not connect.\n";
} else {
  print "Connected!!\n";
}

?>

output from CGI php

[root@ns dosojin]# php odbc_test.html
X-Powered-By: PHP/4.0.0
Content-type: text/html

Connected!!
Segmentation fault (core dumped)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-31 09:09 UTC] kara at cvs dot php dot net
Please try compiling with --with-unixODBC instead of 
--with-esoob, and report back if this helps. 
 [2000-05-31 16:59 UTC] cnewbill at onewest dot net
I have tried that it does not recognize OOB then as a valid driver no matter how nice I ask.
 [2000-06-20 12:09 UTC] lurcher at cvs dot php dot net
Did the warnings happen when you linked --with-unixODBC ?
Did you link to the unixODBC that comes with OOB, or a separate install of unixODBC ?
Have you tried to get OOB working via unixODBC outside of PHP, using isql for instance ?
 [2000-06-20 12:09 UTC] lurcher at cvs dot php dot net
Did the warnings happen when you linked --with-unixODBC ?
Did you link to the unixODBC that comes with OOB, or a separate install of unixODBC ?
Have you tried to get OOB working via unixODBC outside of PHP, using isql for instance ?
 [2000-06-20 17:11 UTC] cnewbill at onewest dot net
As Martin from EasySoft said "when you mix unixODBC and Apache/PHP one with threads the other without you get
the exact problem you are seeing".  This sounds about right.  So all I did was remove unixODBC and reinstall OOB with its uncluded unixODBC.  This cleared up the seg faults.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Jun 18 13:00:01 2026 UTC