PDA

View Full Version : Error: undefined symbol SQLAllocEnv at PHP


my5660
1st January 2006, 10:24
Hello,

I am not able to connect to a sybase database via unixODBC in PHP, but testing with isql its able to connect. my server is using based on the SuSE 9.3 distribution,

here my ODBC Setting
ODBC.ini stored in etc/unixODBC

[ODBC Data Sources]
ts_dsn=Adaptive Server Anywhere 9.0

[ts_dsn]
Userid=xxx
Password=yyy
ServerName=hsab_sbs2003
CommLinks=tcpip(host=192.168.0.12;port=2936)
Driver=lbdbodbc9.so

testing with isql its able to connect

For testing the connection I used this file: /srv/www/project/test.php
<?
echo "Begin";
$conn=odbc_connect("ts_dsn","xxx","yyy")
or die ("Failure");

echo "End";
?>

When calling this file, there ist only the text "Begin" displayed in the
browser window. No error. But an error is logged in
/var/log/apache2/error_log:
"/usr/sbin/httpd2-prefork: error while loading shared libraries:
/usr/lib/php/extensions/unixODBC.so: undefined symbol: SQLAllocEnv"

Do you have got an idea what went wrong?:confused:

till
1st January 2006, 13:13
PHP cant load the unixODBC.so. Is the file:

/usr/lib/php/extensions/unixODBC.so

there?. Have you installed the unixODBC extension from your linux distribution or did you compile PHP manually?

my5660
2nd January 2006, 12:48
PHP cant load the unixODBC.so. Is the file:

/usr/lib/php/extensions/unixODBC.so

there?. Have you installed the unixODBC extension from your linux distribution or did you compile PHP manually?
yes i installed the unixODBC extension from my linux distribution, and yes unixODBC.so is in /usr/lib/php/extensions/unixODBC.so

falko
2nd January 2006, 13:41
yes i installed the unixODBC extension from my linux distribution, and yes unixODBC.so is in /usr/lib/php/extensions/unixODBC.so
Have you enabled it in your php.ini? Don't forget to restart Apache afterwards.

my5660
2nd January 2006, 13:49
Have you enabled it in your php.ini? Don't forget to restart Apache afterwards.

its enabled by default

falko
2nd January 2006, 14:35
Does it show up as enabled when you run phpinfo(); in a PHP script?

my5660
2nd January 2006, 15:12
do you mean UnixODBC or ODBC..?

till
2nd January 2006, 15:28
Please have a look here:

http://www.susewiki.org/index.php?title=PHP4_ODBC

my5660
3rd January 2006, 11:17
Please have a look here:

http://www.susewiki.org/index.php?title=PHP4_ODBC
wow,its working...thanks alot till