php.net |  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
Votes:3
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
42 - 24 = ?
Subscribe to this entry?

 
 [2006-09-08 10:52 UTC] david dot rothwell at wolseley dot co dot uk
Description:
------------
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:
---------------
<html>
<head></head>
<body>
<?php
	$dsn="dave-1";
	
	$db_user="";
	$db_pwd="";
	
	echo "Opening connection to Reality host moon-1 using dsn ".$dsn.". Please wait...<br />";


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

	phpinfo();
	?>
</body>
</html>

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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-09 12:07 UTC] jani@php.net
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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 01:01:28 2025 UTC