RE: PHP & Informix on Red Hat Enterprise 5
Posted in 2008
Tnx all for the info.
I just installed unixODBC-2.2.12 and Im now trying to make it work
unfortunately it doesnt:
Env vars INFORMIXDIR=/opt/informix, ODBCINI=/etc/odbc.ini, LD_LIBRARY_PATH
are set.
odbcinst j
unixODBC 2.2.12
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
USER DATA SOURCES..: /etc/odbc.ini
/etc/odbcinst.ini => /usr/local/etc/odbcinst.ini (symbolic link)
[ODBC Drivers]
IBM INFORMIX ODBC DRIVER=Installed
[Informix]
Description=
Driver=/opt/informix/lib/cli/iclis09b.so
#Setup=
APILevel=1
ConnectFunctions=YYY
DriverODBCVer=03.51
FileUsage=0
SQLLevel=1
smProcessPerConnect=Y
/etc/odbc.ini => /usr/local/etc/odbc.ini (symbolic link)
[r69db]
Driver=Informix
Database=testdb
LogonID=informix
pwd=******
Servername=demo_on
CLIENT_LOCALE=en_us.8859-1
DB_LOCALE=en_us.8859-1
TRANSLATIONDLL=/opt/informix/lib/esql/igo4a304.so
[ODBC]
Trace=0
TraceFile=/tmp/odbctrace.out
I tried both drivers iclis09b.so & iclit09b.so without luck.
When I do isql v r69db I get following output:
[IM009][unixODBC][Informix][Informix ODBC Driver]Unable to load translation
shared library (DLL).
[ISQL]ERROR: Could not SQLConnect
Ive checked and /opt/informix/lib/esql/igo4a304.so exists.
ldd /opt/informix/lib/esql/igo4a304.so
linux-gate.so.1 => (0x00548000)
libc.so.6 => /lib/libc.so.6 (0x00110000)
/lib/ld-linux.so.2 (0x008da000)
ldd /opt/informix/lib/cli/iclis09b.so
linux-gate.so.1 => (0x0068c000)
libifgls.so => /opt/informix/lib/esql/libifgls.so (0x00b5f000)
libifglx.so => /opt/informix/lib/esql/libifglx.so (0x0069f000)
libc.so.6 => /lib/libc.so.6 (0x00110000)
libm.so.6 => /lib/libm.so.6 (0x00250000)
libdl.so.2 => /lib/libdl.so.2 (0x00d8b000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00277000)
/lib/ld-linux.so.2 (0x008da000)
ldd /opt/informix/lib/cli/iclit09b.so
linux-gate.so.1 => (0x002e5000)
libifgls.so => /opt/informix/lib/esql/libifgls.so (0x001f1000)
libifglx.so => /opt/informix/lib/esql/libifglx.so (0x0058d000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00e00000)
libc.so.6 => /lib/libc.so.6 (0x00a4f000)
libm.so.6 => /lib/libm.so.6 (0x00110000)
libdl.so.2 => /lib/libdl.so.2 (0x00bf8000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00137000)
/lib/ld-linux.so.2 (0x008da000)
So, Im out of ideas
its probably something stupid, but I cant find it
Tnx for your help,
Jeroen K
From: Mary.Muraski [mailto:mary.muraskiny@adelphia.net]
Sent: donderdag 24 januari 2008 0:53
To: Jeroen Keppens
Subject: Re: PHP & Informix on Red Hat Enterprise 5
Zendcore needs an odbc driver manager to work, That is why this works under
Windows so well.
If you install and configure the UnixODBC, create a data source to point to
the odbc.ini file this should work.
----- Original Message -----
From: Jeroen Keppens <mailto:jeroen.keppens@nmv.be>
Newsgroups: comp.databases.informix
To: informix-list@iiug.org
Sent: Wednesday, January 23, 2008 10:33 AM
Subject: PHP & Informix on Red Hat Enterprise 5
Hi,
I have Zend Core for IBM installed on a Red Hat Enterprise 5.
Im trying to connect to an IDS 10 on another server. Ive been trying for 2
days now, and nothing works
anyone have experience with the same setup and
got it to work?
What I tried first:
Modified $INFORMIXDIR/etc/sqlhosts & /etc/services.
Modified /etc/hosts.equiv on DB server to include webserver
Set INFORMIXDIR & LD_LIBRARY_PATH to point to the Zend Core directory.
Didnt work.
Then I downloaded the CSDK and pointed both to the CSDK install directory.
Didnt work.
Ive set following env variables:
export INFORMIXDIR=/opt/informix
export PATH=$INFORMIXDIR/bin:$PATH
export INFORMIXSERVER=demo_on
export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts
export
LD_LIBRARY_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql:$LD_LIBRARY_PATH
export CLIENT_LOCALE=en_us.819
export DB_LOCALE=en_us.819
Ive tried setting them in:
/etc/profile.d/informix.sh
/etc/bashrc
ð Both show the variables as set when I echo them on the command prompt
But this didnt set them in PHP.
Ive tried adding them to the envvars file in the apache bin directory,
which gets loaded before starting httpd
Ive tried adding them in httpd.conf (KEEPENV & PUTENV)
Ive tried having them all at once
But I still cant connect
This is the script I use: (which works when I have it on windows)
(using pdo_informix)
<?php
try {
$db = new
PDO("informix:host=192.168.10.34;service=50000;database=testdb;server=demo_o
n;protocol=olsoctcp;client_locale=en_us.819;db_locale=en_us.819",
"informix", "********");
$res = $db->query("select * from users");
foreach ($res as $row) {
print_r($row);
}
echo "No error";
} catch (Exception $e) {
print_r($e);
}
?>
This is the error I get at the moment (with CSDK):
PDOException Object
(
[message:protected] => SQLSTATE=08001, SQLDriverConnect: -1013 [IBM][CLI
Driver] SQL10007N Message "0" could not be retrieved. Reason code: "3".
[string:private] =>
[code:protected] => 0
[file:protected] => /usr/local/apache2/htdocs/test.php
[line:protected] => 7
[trace:private] => Array
(
[0] => Array
(
[file] => /usr/local/apache2/htdocs/test.php
[line] => 7
[function] => __construct
[class] => PDO
[type] => ->
[args] => Array
(
[0] =>
informix:host=192.168.10.34;service=50000;database=testdb;server=demo_on;pro
tocol=olsoctcp;client_locale=en_us.819;db_locale=en_us.819
@@