[unixODBC-support] Segmentation fault error during odbc_exec

Hardeep Nahal nahal at csb.utoronto.ca
Thu Jul 12 20:33:21 BST 2007


Hello,

We're having problems trying to connect and execute to our database  
using unixodbc and mdbtools (Microsoft Database Tools). This is our  
test script:

<?php
$myDB = odbc_connect("Dogs","","");
$query = "select name, weight from dog_list";
$result = odbc_exec($myDB, $query);
//while (odbc_fetch_row($result)) {
//print "Name = " . odbc_result($result,"name");
//print "
//Weight = " . odbc_result($result,"weight");
//}
?>

When trying to run this script on the web, I get a pop up notifying me  
"You have chosen to open test.php which is a: PHP script". I've gone  
through a few postings from people who have had the same problem, and  
it was suggested that the script was getting hung up somewhere and  
timing up, forcing the server to think it should open the php script.  
So I tried executing this test php script via command line, and found  
out we were getting a "Segmentation Fault" error:

me at server:# php test.php
Segmentation fault


I commented out the last 5 lines in an effort to narrow down which  
line was causing the Segmenation Fault error, and it appears the  
script stalls at the odbc_exec statement. However, we have been unable  
to find out what might be causing this. Our obdbc.ini configuration  
file looks like as follows:

[Dogs]
Description=Microsoft Access Database of Dogs
Driver=/usr/lib/libmdbodbc.so
Database=/home/john/test.mdb
Servername=localhost
UserName=
Password=
port=5432

Does anyone know why we might be getting this error? We're running  
Debian, PHP5, unixODBC 2.2.12. mdbtools version 0.5.99.0.6pre1.0.2005  
(installed via apt-get install). Please let me know if you require  
additional information if you think it might help. Any suggestions  
would be greatly appreciated.

Thanks,
Hardeep




More information about the unixODBC-support mailing list