Re: php3 + apache + redhat + ibm db2
| From: | Mirko Nalesso | Date: | Wed, 23 Aug 2000 08:35:49 +0000 |
| Subject: | Re: php3 + apache + redhat + ibm db2 | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2291@lists.php.net to get a copy of this message | ||
Hi
There are few things to consider
1. I use php4 (last version) and I compile it --with-ibm-db2 option
(before you must set LDFLAGS).
2. I put my odbcinst.ini and odbc.ini in /etc directory, since you will
be connecting to system wide DSN's anyway....
3. My .odbc.ini file is:
[sample]
Description = Test to DB2
Driver = DB2
and my odbcinst..ini file is:
[ODBC]
Trace = Yes
Trace File = /tmp/sql_trace.log
[DB2]
Description = DB2 driver
Driver = /usr/IBMdb2/V6.1/lib/libdb2.so
FileUsage = 1
DontDLClose = 1
4. make sure you have DB@INSTANCE variable set up....the best thing to
do is to execute "#. /home/db2inst1/sqllib/db2prifile" or put the
equivalent into /etc/profile so evryone will be able to use it....
6. Your odbcinst.ini driver must be libdb2.so: it's a shared lib; db2.o
comes on AIX flavor.....
I hope this helps....
Mirko.
> hi all,
>
> i've some problems abt using php3 to connect db2 in redhat, can u pls
give
> me some advice?
>
>
>
************************************************************************
****
> ************************
> IBM DB2
> --with-ibm-db2=DIR
>
> Enables IBM DB2 support. The parameter to this option is the DB2 base
> install directory and defaults to /home/db2inst1/sqllib
>
> from http://www.php.net
>
************************************************************************
****
> ************************
>
> i've installed db2 and create an instance "db2inst" with password
"ibmdb2"
> and therefore i configure as follow:
>
> ./configure ... --with-ibm-db2=/home/db2inst/sqllib ...
>
>
> after that, using phpinfo(), i can see that the setting of the part of
> "ODBC/odbc" is as follow...
>
>
************************************************************************
****
> *************************
> ODBC/odbc:
>
> Unified ODBC Support active (compiled with IBM DB2)
> allow_persistent: -1
> max_persistent: -1
> max_links: -1
>
************************************************************************
****
> *************************
>
> then i use "db2sampl" to create a sample database under db2 command
line
> it works fine
>
> so, i tried to create an php file to test for the connection
> here is the code of my file:
>
>
************************************************************************
****
> *************************
> <?
>
> $db_database = "sample";
> $db_user = "db2inst";
> $db_passwd = "ibmdb2";
>
> $a = odbc_pconnect($db_database, $db_user, $db_passwd);
>
> print("a: $a");
>
> ?>
>
************************************************************************
****
> *************************
>
> and here is what i see when i load the page:
>
>
************************************************************************
****
> *************************
> Warning: SQL error: üåÿ??¿XÿÿÿÿIéE@?@Õz@, SQL state
> db_dP?¿Ø db_d in SQLConnect in /var/www/servers/index.php3 on
> line 7
> a:
>
************************************************************************
****
> *************************
>
> whats wrong with my code?
> can u pls kindly give more detailed advice for such a newbie like me?
>
> thx in advance!
>
> leekit
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail:
php-list-admin@lists.php.net
>
>