|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38749 odbc_connect failing on Unix platform
Submitted: 2006-09-08 10:52 UTC Modified: 2007-07-09 12:07 UTC
Avg. Score:4.0 ± 1.4
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: david dot rothwell at wolseley dot co dot uk Assigned:
Status: Wont fix Package: ODBC related
PHP Version: 5.1.6 OS: SunOS 5.9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: david dot rothwell at wolseley dot co dot uk
New email:
PHP Version: OS:


 [2006-09-08 10:52 UTC] david dot rothwell at wolseley dot co dot uk
Using odbc_connect is resulting in SQL state 08001 when using third party odbc driver. ODBC client program isql connects ok using the same driver. What are the primary differences between the two methods. Tracing of the third party application suggests the connection request is being made. The configure line is:
'./configure' '--with-apxs2=/usr/local/apache-2.0.54/bin/apxs' '--prefix=/usr/local/apache-2.0.54/php' '--enable-threads=posix' '--enable-cgi-redirect' '--with-mysql=/usr/local/mysql' '--with-oci8=shared,instantclient,/var/opt/oracle/instantclient' '--enable-sigchild' '--enable-inline-optimization' '--with-zlib' '--with-gd' '--with-freetype-dir=/usr/local/freetype-2.2.1' '--with-pdflib=/usr/src/packages/PDFlib-6.0.3p1-SunOS-sparc/bind/c' '--with-jpeg-dir=/usr/local/lib' '--with-png' '--with-ttf' '--with-xpm-dir=/usr/local' '--enable-gd-native-ttf' '--with-unixODBC=/usr/local'

Reproduce code:
	echo "Opening connection to Reality host moon-1 using dsn ".$dsn.". Please wait...<br />";

    $rfp = odbc_connect($dsn, $db_user, $db_pwd);
		echo "Connected to ".$dsn;
	} else {
		echo "Connection failed!";
	echo "<hr>";


Expected result:
A connection to remote system allowing queries to be executed


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-09 12:07 UTC]
Obviously that "3rd party odbc driver" is not supported by PHP odbc extension. Try using pdo_odbc instead. Won't fix in ext/odbc.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Mar 26 00:03:53 2023 UTC