Re: PDOException with message 'SQLSTATE[] SQLSetEnvAttr: ODBC3: 0'
| From: | Dan Scott | Date: | Tue, 02 Aug 2005 19:34:30 +0000 |
| Subject: | Re: PDOException with message 'SQLSTATE[] SQLSetEnvAttr: ODBC3: 0' | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2712@lists.php.net to get a copy of this message | ||
This probably means that your DB2 instance environment hasn't been set
up before trying to connect.
Try:
bash$ . /home/db2inst1/sqllib/db2profile
to set the appropriate environment variables before connecting. You
probably need to add this line to your Web server init script; common
problem is that you run that command once as root, restart the Web
server, and everything's good until you have to reboot weeks or months
later and you've forgotten what the solution to the problem is... :)
Dan
On 8/2/05, Matthew Peters <matthew_peters@uk.ibm.com> wrote:
> This is my first attempt to use PHP/PDO/DB2 on Linux and I get the
> subject message when I do $dbh = PDO('odbc:company',<user>,<passwd>);
>
> Does anyone know what the cause might be? Is there a way to get more info?
>
> I am running PHP 5.1.0b3 on Linux, configured --with-pdo-odbc=ibm-db2
> on top of IBM DB2 8.1. I watched while it configured and I checked it
> was picking up the include files it needed for db2 from the right place.
>
> I can see the PDO driver showing up in the phpinfo() page, both as an
> entry in the PDO box and as a separate PDO_ODBC box.
>
> --
> PECL development discussion Mailing List (http://pecl.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>