For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > February 2007 > unixODBC + PHP 4.4.4









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author unixODBC + PHP 4.4.4
Drewfus

2007-02-13, 7:59 am

Hi,

I've installed unixODBC with the EasySoft ODBC Driver and have connectivity
working to my MS-SQL Server fine. I can login with the iSQL tool and
perform queries without issue - I then moved onto recompiling PHP/Apache
with unixODBC support, but when testing it I see:

*Fatal error*: Call to undefined function: odbc_connect()

The PHP script is pretty basic:

<?php
putenv("ODBCINI=/etc/odbc.ini");
putenv("ODBCINSTINI=/etc/odbcinst.ini");
putenv("LD_LIBRARY_PATH=/usr/local/easysoft/unixODBC/lib");

$Conn= odbc_connect ("db","user","pass")
or die ("Can't open ODBC-DSN");
$Rec = odbc_exec ( $Conn, "select * from viewDB")
or die ("Can't execute QUERY");

echo "Records returnd : ".odbc_num_rows($Rec)."<br>\n";
echo "<br>\n";
?>

I verified that during the configure, With unixODBC Support was showing up
as Yes, also there were no compile errors whatsoever. When I check
phpinfo() - I see the following configure command:

'./configure' '--with-png-dir=/usr/local/lib'
'--with-zlib-dir=/usr/local/lib' '--with-gd'
'--with-apache=../apache_1.3.27'
'--with-unixODBC=shared,/usr/local/easysoft/unixODBC' '--without-mysql'
'--with-oracle=/u01/OraHome1' '--with-oci8=/u01/OraHome1'

The build date is updated with today's date, and the Oracle connectivity
still works - any ideas on why odbc_connect would be an undefined function
with that configure command?

Thanks,
-D

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com