From: david dot rothwell at wolseley dot co dot uk
Operating system: SunOS 5.9
PHP version: 5.1.6
PHP Bug Type: ODBC related
Bug description: odbc_connect failing on Unix platform
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
--
Edit bug report at http://bugs.php.net/?id=38749&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38749&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38749&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38749&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38749&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38749&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38749&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38749&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38749&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38749&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38749&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38749&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38749&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38749&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38749&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38749&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38749&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38749&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38749&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38749&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38749&r=mysqlcfg