|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-11 22:29 UTC] tony2001@php.net
[2006-12-11 22:48 UTC] webmaster at guestwho dot com
[2006-12-11 22:59 UTC] tony2001@php.net
[2006-12-11 23:16 UTC] webmaster at guestwho dot com
[2006-12-11 23:19 UTC] webmaster at guestwho dot com
[2006-12-11 23:21 UTC] tony2001@php.net
[2006-12-11 23:39 UTC] webmaster at guestwho dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 09:00:01 2025 UTC |
Description: ------------ I have been trying to connect a microsoft access database using PHP, mdbtools and unixODBC, but any attempt at calling odbc_connect() results in an immediate segfault. This behaviour occurs in both the shared apache module and the standalone cgi version. Only the latter dumps core though. PHP is configured as follows: ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql \ --with-zlib --with-pdo-mysql=/usr/local/mysql --enable-mbstring \ --with-curl=/usr/local --enable-debug --with-openssl=/usr/local/ssl \ --with-gd --with-custom-odbc=/usr/local Here are the unixODBC configs: odbcinst.ini ------------- [MDBToolsODBC] Description = MDB Tools ODBC drivers Driver = /usr/local/lib/libmdbodbc.0 Setup = FileUsage = 1 CPTimeout = CPReuse = DisableGetFunctions = 0 UsageCount = 1 -------------- odbc.ini -------------- [Water] Description = Water Module Driver = MDBToolsODBC Trace = Yes TraceFile = /var/log/sql.log Database = /home/skeleton-man/public_html/water/water.mdb Servername = localhost UserName = Password = --------------- Reproduce code: --------------- <? $myDB = odbc_connect('Water','',''); $query = "SELECT RLCode FROM Account"; $result = odbc_exec($myDB, $query); while (odbc_fetch_row($result)){ print odbc_result($result,'RLCode')."<br>"; } ?> Expected result: ---------------- It should print a list of account numbers from the RLCode column in the database. Actual result: -------------- PHP segfaults immediately with no output. Backtrace: #0 0x082ef680 in zend_hash_find (ht=0x8829668, arKey=0x884137c "unixODBC_Water___2", nKeyLength=19, pData=0x10000) at /usr/local/src/php-5.2.0/Zend/zend_hash.c:849 #1 0x081a26ac in odbc_do_connect (ht=3, return_value=0x8841364, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, persistent=0) at /usr/local/src/php-5.2.0/ext/odbc/php_odbc.c:2341 #2 0x081a1c13 in zif_odbc_connect (ht=3, return_value=0x8841364, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /usr/local/src/php-5.2.0/ext/odbc/php_odbc.c:2053 #3 0x083008a6 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfbfd510) at zend_vm_execute.h:200 #4 0x0830002d in execute (op_array=0x8840a84) at zend_vm_execute.h:92 #5 0x082e87c3 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-5.2.0/Zend/zend.c:1097 #6 0x082b1ee5 in php_execute_script (primary_file=0xbfbfec00) at /usr/local/src/php-5.2.0/main/main.c:1758 #7 0x083615ba in main (argc=2, argv=0xbfbfeca8) at /usr/local/src/php-5.2.0/sapi/cgi/cgi_main.c:1625