Hi to all!!

I have a problem and i think maby somebody can help me.

I have an MS Sql server on a Windows 2000.
I have a PHP web in a linux debian. Im trying to access to the MS SQL server through 
Unixodbc  works well becouse y test it under linux , with isql and sqsh, and i know 
that it works.
in my PHP code I load the odbc module with dl('odbc'), and it works, but 
the problem is that when i do odbc_pconnect("mydsn","myuser","mypasswd"); y have an 
error like this:

Warning: SQL error: [unixODBC] Could not find DSN in odbc.ini, SQL state 08001 in 
SQLConnect in /path/to/my/page.php on line XX 
Warning: Supplied argument is not a valid ODBC-Link resource in /path/to/my/page.php 
on line XX 

When i test the odbc with isql under linux, i think that isql find an .odbc.ini under 
the file is like this:
[ODBC Data Sources]
cdr2 = FreeTDS

Servername =
TraceFile = /tmp/odbc.log
Driver = /usr/lib/odbc/libtdsodbc.so
Description = logs del call manager.
DSN = cdr2
User = myuser
Password = mypasswd
Port = 1433

Driver = /usr/lib/odbc/libtdsodbc.so

and i think that the problem is that apache user dont find this file. My apache user 
is www-data, and i try to copy an .odbc.ini file to this user $HOME, but dont works...

the conclusions are: 
1 ODBC works 
2 I have PHP compiled with ODBC support.
3 other users with an .odbc.ini file under $HOME can access to ODBC.

but the problem is still there :(  
so my question is: how can i access from PHP on debian to a well configured ODBC ?

thanks in advance!!

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to