Teradata ODBC-Connect from PHP (Linux Red Hat)

Connectivity
N/A

Teradata ODBC-Connect from PHP (Linux Red Hat)

Hi,

I am trying to connect Teradata from Linux Red Hat ( LAMP-Installation ) via ODBC-Driver.
isql works fine, but i cant connect Teradata with PHP.

SQL error : SQl State in 00000 in SQLConnect ...

( Teradata ODBC Version 13.0 - Red Hat 4.0 )

Has anybody working a PHP/Teradata Connection and know a solution ?

Thanks !
Tags (2)
4 REPLIES
Teradata Employee

Re: Teradata ODBC-Connect from PHP (Linux Red Hat)

Can you more details like code snippet ...

Re: Teradata ODBC-Connect from PHP (Linux Red Hat)

I am interested in doing this as well, having some issues.

I have unixODBC installed, odbc.ini as such; Have removed user/pass/dbcname

[ODBC]
InstallDir=/usr/odbc/lib/
Trace=0
TraceDll=/usr/odbc/lib/odbctrac.so
TraceFile=/tmp/trace.log
TraceAutoStop=0

[ODBC Data Sources]
default=tdata.so
TD=tdata.so

[TD]
Driver=/usr/odbc/lib/tdata.so
Description=Teradata running Teradata V1R5.2
DBCName=
LastUser=
Username=
Password=
Database=
DefaultDatabase=

using 13.0 drivers;

/opt/teradata/client/13.0/odbc_32/lib/tdata.so

# pwd
/usr/odbc/drivers
# ls -al
total 20
drwxr-xr-x 2 root root 4096 Jan 27 12:19 .
drwxr-xr-x 3 root root 4096 Jan 27 12:19 ..
lrwxrwxrwx 1 root root 41 Jan 27 12:19 tdata.so -> /opt/teradata/client/ODBC_32/lib/tdata.so
#

using php as follows (password removed )

putenv("ODBCINI=/etc/odbc.ini");

echo "Testing ODBC \n\n";

$dh = odbc_connect("TD", "", "") or die(odbc_errormsg()."\n\n");
odbc_close($dh);

?>

results in a seg fault

# tail /var/log/httpd/error_log
[Thu Jan 27 20:20:21 2011] [notice] child pid 21462 exit signal Segmentation fault (11)
[Thu Jan 27 20:20:23 2011] [notice] child pid 21477 exit signal Segmentation fault (11)
[Thu Jan 27 20:20:37 2011] [notice] child pid 21467 exit signal Segmentation fault (11)
[Thu Jan 27 20:24:47 2011] [notice] child pid 21555 exit signal Segmentation fault (11)
[Thu Jan 27 20:24:53 2011] [notice] child pid 21461 exit signal Segmentation fault (11)
[Thu Jan 27 20:30:44 2011] [notice] child pid 21557 exit signal Segmentation fault (11)
[Thu Jan 27 20:31:03 2011] [notice] child pid 21558 exit signal Segmentation fault (11)
[Thu Jan 27 20:31:09 2011] [notice] child pid 21571 exit signal Segmentation fault (11)
[Thu Jan 27 20:50:01 2011] [notice] child pid 21572 exit signal Segmentation fault (11)

I am able to use this ODBC to other databases, thinking this may be a PHP problem?
Highlighted
Fan

Re: Teradata ODBC-Connect from PHP (Linux Red Hat)

Hi,

Did you ever get your PHP-to-Teradata connection working? I am trying to do the same thing, getting and error: Can't open tdata.so. File not found.
Teradata Employee

Re: Teradata ODBC-Connect from PHP (Linux Red Hat)

See the other thread

http://forums.teradata.com/forum/connectivity/teradata-odbc-driver-with-apachephp