Hi,
I am trying to connect an Ingres web server to Ingres R3 via ODBC. Works
fine. Almost. I get Net and ODBC working via isql (also both netutil and
iiodbcadmn report back fine when testing the connection), but I get this
error from the Apache error_log:
PHP Warning: odbc_connect() [<a
href='function.odbc-connect'>function.odbc-connect</a>]: SQL error:
[unixODBC][Driver Manager]Can't open lib
'/opt/CA/IngresII/ingres/lib/libiiodbcdriver.1.so' : libq.1.so: cannot
open shared object file: No such file or directory, SQL state 01000 in
SQLConnect in /var/www/html/odbc/index.php on line 3
The strange bit: libiiodbcdriver.1.so and libq.1.so reside in the same
directory. LD_LIBRARY_PATH seems to help Apache/PHP find the former, and
I would assume it would also help it find the latter. But no dice.
However, on a similar box running Windows/Apache/PHP, there are no
problems. So I am vaguely guessing that there is some sort of environment
variable I need to pass on. But searching the web has not helped much. And
so I turn to the experts.
I am running Ingres R3 on a Red Hat Enterprise Linux 3 server and Apache
2.0.52-3.1 with PHP 5.0.4-10 and all the required Ingres trimmings
(rpm-based net/odbc etc - no dbms) on a Fedora 3 machine.
Best regards,
Arild
grant - 19 May 2005 16:25 GMT
Hi Arild
you normally need to have the following defined in the script that
starts up apache.
II_SYSTEM
LD_LIBRARY_PATH
ODBCSYSINI
if you are using pre-configured DSNs then you also need
ODBCINI
in apache's configuration file (i am not familar with Fedora/RH config
layout) you will need to PassEnv the above variables. Make sure
mod_env is being loaded otherwise that will fail.
I am trying to get PHP to build against the Ingres ODBC/CLI removing
the need to use unixODBC. That however it is proving tricky at the
moment.
regards
grant