Re: IBM DB2 and DSN
| From: | Yasuhide OMORI | Date: | Thu, 04 Jan 2001 11:41:10 +0000 |
| Subject: | Re: IBM DB2 and DSN | ||
| References: | 1 2 3 4 5 6 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5591@lists.php.net to get a copy of this message | ||
This problem seems to be solved.
On Thu, Jan 04, 2001 at 08:02:56PM +0900,
Yasuhide OMORI <omori@m-t.com> wrote:
> Thanx for a lot of information.
> It seems that I'm in trouble before the step of PHP...
>
> On Wed, Jan 03, 2001 at 11:12:05AM -0800,
> "szii@sziisoft.com" <szii@surfmetro.com> wrote:
> > Well, if you're connecting to a remote machine and haven't run
> > the "catalog" command to use that database on that node you'll
> > run into "can't find database" problems. Using the full ODBC
> > DSN will alleviate that. If you use just the database name, make
> > sure you've run a "catalog node..." and "catalog database"
> > command
> > to let your client know where that database really lives.
>
> I succeeded in creating a catalog entry but I met another problem with
> code pages...
I don't know why but I logined again and this problem disappered.
> > Oh, and either run Apache as your db2inst1 user (or whomever you've
> > setup) or make sure you get all of the exports from the db2profile/db2cshrc
> > files and have them in the envirionment before you call odbc_connect().
> > If your env's not setup right, you'll get bogus SQLState error messsages
> > (random garbage.)
>
> How can I source /home/db2inst1/sqllib/db2profile or
> /home/db2inst1/sqllib/db2cshrc with php? Or is there some convenient
> function to use?
>
> I added /usr/IBMdb2/V6.1/lib to /etc/ld.so.conf. Isn't it enough?
It is not enough. I had to add the following line to the PHP script:
putenv("DB2INSTANCE=db2inst1");
--
Yasuhide OMORI