unixODBC + PHP 4.4.4
am 13.02.2007 11:08:42 von Drewfus
------=_Part_63554_19149730.1171361322812
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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:
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)."
\n";
echo "
\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
------=_Part_63554_19149730.1171361322812--
Re: unixODBC + PHP 4.4.4
am 14.02.2007 01:46:20 von dmagick
> './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?
When you compile with the 'shared' option, you need to make sure either
the php.ini loads the .so file or you do using http://www.php.net/dl
Is either happening?
Check with a phpinfo page.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: unixODBC + PHP 4.4.4
am 14.02.2007 03:11:10 von bedul
----- Original Message -----
From: "Drewfus"
To:
Sent: Tuesday, February 13, 2007 5:08 PM
Subject: [PHP-DB] unixODBC + PHP 4.4.4
> 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:
i do believe the odbc on your comp are not configure yet.
another problem may cause from ODBC library (php)
for oracle.. u can connect without using odbc (since oracle have own
library)
i suggest you search for the library (odbc) if you don't use oracle (i read
below)
or perhaps u search for oracle libary instead odbc..
>
> putenv("ODBCINI=/etc/odbc.ini");
> putenv("ODBCINSTINI=/etc/odbcinst.ini");
> putenv("LD_LIBRARY_PATH=/usr/local/easysoft/unixODBC/lib");
i don't think above is necessary.. since the default PHP must already
connect to the odbc..
>
> $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)."
\n";
> echo "
\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
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php