Php and db2

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
pablo_k
Forum Newbie
Posts: 2
Joined: Wed Jan 22, 2003 10:12 am

Php and db2

Post by pablo_k »

Hi
I have a problem with the odbc_connect function when i try to connect with a IBM db2 database.
I'm using Red Hat Linux 7.1 with php and apache.
When odbc_connect executes, apache web server doesn't show the page and the /usr/local/apache/log/error_log shows:

/usr/local/apache/bin/httpd: error while loading shared libraries: /usr/local/apache/bin/httpd: undefined symbol: SQLAllocEnv

Any idea??
Thanks

Pablo_k
thomaska
Forum Newbie
Posts: 5
Joined: Thu Jan 23, 2003 1:22 am

Post by thomaska »

Did you install the DB2 Client (including ADT) on the Apache Server and recompile PHP?
pablo_k
Forum Newbie
Posts: 2
Joined: Wed Jan 22, 2003 10:12 am

Post by pablo_k »

Hi:
I have installed the next modules:
DB2 Administration Client
DB2 UDB enterprise edition
DB2 connect enterprise edition
DB2 Application Development client

and i have recompiled php with apache:
php:
./configure --with-ibm-db2=/usr/IBMdb2/V7.1 --with-mysql --with-apache=/usr/src/apache_1.3.27

apache:
./configure --activate-module=src/modules/php4/libphp4.a

...and don't work.
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

I'd suggest asking at comp.databases.ibm-db2 also.
A number of IBMer's give advice, etc. and may know the solution right off the bat. Be sure and tell them the version of DB2 and any other pertinant
info.

I use Db2, but with ASP, so don't know what issues you may have with Linux.

Anyway, good luck! Let us know how/if you resolve the issue.

Phil J.
thomaska
Forum Newbie
Posts: 5
Joined: Thu Jan 23, 2003 1:22 am

Post by thomaska »

Did you define in db2 a "connection" to the database and did you include
....
# DB2 Konfiguration:
#
. /home/db2inst1/sqllib/db2profile
#
....

into your apache start script?

This will set all environment variables well for db2.
User avatar
d-m
Forum Commoner
Posts: 31
Joined: Fri Aug 29, 2003 4:24 pm
Location: Rio de Janeiro - RJ - Brasil

Post by d-m »

I remember that I have already explain at http://www.php.net years ago how to compile php with db2... please check at these link :

http://www.php.net/manual/en/function.odbc-connect.php

At the comments of the funcion... It has the solution!

:mrgreen:

I hope it could help U
Post Reply