RE: [PHP-DB] Re: problem with php and unixODBC
Marten, Look at the output of a phpinfo() when you have the putenv()'s - you can see that there are a couple of different environments here. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Virtuoso Universal Server -Original Message- From: Marten Lehmann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 14, 2002 4:59 AM To: Nick Gorham Cc: [EMAIL PROTECTED] Subject: [PHP-DB] Re: problem with php and unixODBC Hello, I know its a little late, but I have only just been pointed to your posting, I would guess the error you are getting database not found is coming from the sybase driver, not the driver manager. I solved the problem a week ago. It was just when I wanted to try iODBC when I saw some putenv()-lines in the examples. I put the appropriate lines in my php-script and then it worked. What I don't unterstand is: When I'm running isql in the shell I can connect to the remote-ressource. When I start apache in the same shell I can't connect through PHP, I first have to set the ODBCINSTINI and ODBCINI env-variables. Why don't I need them in the shell? Regards Marten -- Variomedia IT-Service GmbH | Benzstrasse 22 | 14482 Potsdam http://www.variomedia.de | Hotline: 0800-5588550 | Fax: 0331-7404043 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: problem with php and unixODBC
Hello, I know its a little late, but I have only just been pointed to your posting, I would guess the error you are getting database not found is coming from the sybase driver, not the driver manager. I solved the problem a week ago. It was just when I wanted to try iODBC when I saw some putenv()-lines in the examples. I put the appropriate lines in my php-script and then it worked. What I don't unterstand is: When I'm running isql in the shell I can connect to the remote-ressource. When I start apache in the same shell I can't connect through PHP, I first have to set the ODBCINSTINI and ODBCINI env-variables. Why don't I need them in the shell? Regards Marten -- Variomedia IT-Service GmbH | Benzstrasse 22 | 14482 Potsdam http://www.variomedia.de | Hotline: 0800-5588550 | Fax: 0331-7404043 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: problem with php and unixODBC
Marten Lehmann wrote: Hello, my unixODBC-2.2.2 installation works fine. I tested the configuration with a local and a remote ressource to a Sybase Adaptive Server Anywhere database with isql (a testing tool of unixODBC). Thus the settings in the odbc.ini and odbcinst.ini should be correct. But when I'm using PHP-4.2.1 with unixODBC-support, I can connect to the local ressource only, not to the remote-ressource, although it worked with isql. Do you have any general ideas, why it doesn't work? Are there known issues about the unixODBC-implementation in php? PHP always says unable to connect to server: database not found. But as I told before, the odbc.ini settings are correct. It seems that php tries to connect to a local server although in odbc.ini CommLinks-settings are defined. Does maybe php don't receive the odbc.ini data correct? I thought that it might be a permission problem, but I ran apache 1.3.26 (with php as module) with the same user to whom all the files and databases belong and I got no positive result. Hi, I know its a little late, but I have only just been pointed to your posting, I would guess the error you are getting database not found is coming from the sybase driver, not the driver manager. PHP doesn't get involved with the odbc.ini data, just the driver manager, but the sybase driver also needs to find its ini files, it doesn't get them from the driver manager ini file, but its own. Can you first try using apache in single user mode, ie httpd -X, as the same user that can connect (say using isql) to the sybase driver, if one can connect, but the other not, I would then try strace -o /tmp/stlog httpd -X then try and connect and have a look (send me a copy if you want) of the log, it should show what files and drivers its trying to load. --- Nick Gorham Easysoft. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php