Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PHP & Informix on Red Hat Enterprise 5

292 views
Skip to first unread message

Jeroen Keppens

unread,
Jan 23, 2008, 10:33:36 AM1/23/08
to inform...@iiug.org

Hi,

 

I have Zend Core for IBM installed on a Red Hat Enterprise 5.

 

I’m trying to connect to an IDS 10 on another server. I’ve 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. Didn’t work.

 

Then I downloaded the CSDK and pointed both to the CSDK install directory. Didn’t work.

 

I’ve 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

 

I’ve 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 didn’t set them in PHP.

 

I’ve tried adding them to the envvars file in the apache bin directory, which gets loaded before starting httpd…

 

I’ve tried adding them in httpd.conf (KEEPENV & PUTENV)…

 

I’ve tried having them all at once…

 

But I still can’t 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_on;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;protocol=olsoctcp;client_locale=en_us.819;db_locale=en_us.819

                            [1] => informix

                            [2] => ********

                        )

 

                )

 

        )

 

    [errorInfo] =>

)

 

Any ideas? Would be very very very greatfull…

 

How does pdo_ibm work with Informix btw? Tried that as well, but didn’t work either J

 

Tnx in advance

Jeroen Keppens

Paul Watson (Oninit LLC)

unread,
Jan 23, 2008, 11:45:08 AM1/23/08
to Jeroen Keppens
Trying building the PHP from source BUT the last time I look at this the
informix pdo was not allowed - invalid option

Cheers
Paul

Manas Dadarkar

unread,
Jan 23, 2008, 12:32:09 PM1/23/08
to Jeroen Keppens, inform...@iiug.org
Hi Jeroen,
Looking at your mails, I see that you have been trying to use multiple (and some incompatible) products. This is what is supported

PDO_IBM will work with IDS 11.1 and beyond only. Also, it will require the IBM common CLI driver version 9.5 and beyond
PDO_INFORMIX will work with IDS 10. It will require the Informix ODBC driver (part of Informix CSDK)

The error that you are getting tells me that you are ending up using the CLI driver instead of the Informix ODBC driver.

Thanks,
-Manas

_______________________________________________
Informix-list mailing list
Inform...@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list


Brad Patterson

unread,
Jan 23, 2008, 12:44:28 PM1/23/08
to pa...@oninit.com, inform...@iiug.org
I set those variables at the beginning of apachectl. You can source
them in from an environment file if you like.

And yes, I've found that anything later than PHP 5.2.2 won't allow
pdo_informix to compile in a source build.

Brad

Jeroen Keppens

unread,
Jan 24, 2008, 10:05:30 AM1/24/08
to inform...@iiug.org

Tnx all for the info.

 

I just installed unixODBC-2.2.12 and I’m now trying to make it work… unfortunately it doesn’t:

 

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

 

I’ve 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, I’m out of ideas…  it’s probably something stupid, but I can’t find it…

 

Tnx for your help,

 

Jeroen K

 

From: Mary.Muraski [mailto:mary.mu...@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 -----

Newsgroups: comp.databases.informix

Sent: Wednesday, January 23, 2008 10:33 AM

Subject: PHP & Informix on Red Hat Enterprise 5

Jeroen Keppens

unread,
Jan 24, 2008, 11:03:37 AM1/24/08
to Sheshnarayan Agrawal, informix-l...@iiug.org, inform...@iiug.org

Hi,

 

I checked and I have CSDK.2.90.UC4.

 

I can’t find UC6 on the IBM site. Does anyone have the linux 32bit available that I can download?

 

Tnx,

Jeroen K

 

From: Sheshnarayan Agrawal [mailto:shag...@in.ibm.com]
Sent: donderdag 24 januari 2008 16:41
To: Jeroen Keppens
Cc: inform...@iiug.org; informix-l...@iiug.org
Subject: RE: PHP & Informix on Red Hat Enterprise 5

 


>[IM009][unixODBC][Informix][Informix ODBC Driver]Unable to load translation shared library (DLL). [ISQL]ERROR: Could not SQLConnect

Shesh : What version of CSDK (ODBC) are you using?  If you are using CSDK <= 2.90.xC5 you will encouter this problem. This was fixed (PTS : 175992) from CSDK 2.90.xC6 onwards with respect to unixODBC DM. Beside if you use unixODBC DM <= 2.2.8 you will not encounter this problem. There was some change in unixODBC DM 2.2.11 onwards which caused this failure and we also needed some changes(PTS : 175992) to fix that.

-Shesh



"Jeroen Keppens" <jeroen....@nmv.be>
Sent by: informix-l...@iiug.org

24/01/2008 20:35

To

<inform...@iiug.org>

cc

Subject

RE: PHP & Informix on Red Hat Enterprise 5

 

Jeroen Keppens_______________________________________________

Art S. Kagel (Oninit LLC)

unread,
Jan 24, 2008, 11:37:27 AM1/24/08
to Jeroen Keppens, inform...@iiug.org
Jeroen Keppens wrote:
>
> Hi,
>
>
>
> I checked and I have CSDK.2.90.UC4.
>
>
>
> I can’t find UC6 on the IBM site. Does anyone have the linux 32bit
> available that I can download?
>

This is like deja-vous all over again! The current release of the CSDK
is 3.00, you CAN download that release from the IBM site and that works
fine.

Art S. Kagel

>
>
> Tnx,
>
> Jeroen K
>
>
>
> *From:* Sheshnarayan Agrawal [mailto:shag...@in.ibm.com]
> *Sent:* donderdag 24 januari 2008 16:41
> *To:* Jeroen Keppens
> *Cc:* inform...@iiug.org; informix-l...@iiug.org
> *Subject:* RE: PHP & Informix on Red Hat Enterprise 5


>
>
>
>
> >[IM009][unixODBC][Informix][Informix ODBC Driver]Unable to load
> translation shared library (DLL). [ISQL]ERROR: Could not SQLConnect
>
> Shesh : What version of CSDK (ODBC) are you using? If you are using
> CSDK <= 2.90.xC5 you will encouter this problem. This was fixed (PTS :
> 175992) from CSDK 2.90.xC6 onwards with respect to unixODBC DM. Beside
> if you use unixODBC DM <= 2.2.8 you will not encounter this problem.
> There was some change in unixODBC DM 2.2.11 onwards which caused this
> failure and we also needed some changes(PTS : 175992) to fix that.
>
> -Shesh
>
>


===========================================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:

http://www.oninit.com/home/disclaimer.php

===========================================================================================

Gerardo Santana

unread,
Jan 25, 2008, 11:07:13 AM1/25/08
to

Art S. Kagel (Oninit LLC) wrote:
> Jeroen Keppens wrote:
> >
> > Hi,
> >
> >
> >
> > I checked and I have CSDK.2.90.UC4.
> >
> >
> >
> > I can't find UC6 on the IBM site. Does anyone have the linux 32bit
> > available that I can download?
> >
>
> This is like deja-vous all over again! The current release of the CSDK
> is 3.00, you CAN download that release from the IBM site and that works
> fine.

I wouldn't blame Jeroen. I was confused the first time I tried to get
the CSDK too (under Trials?, at a search result page? what the ...?)

Jeroen, _if you can afford it_, try a real language, like Python or
Ruby.

Jeroen Keppens

unread,
Jan 25, 2008, 3:25:07 PM1/25/08
to Gerardo Santana, inform...@iiug.org
The version I needed isn't there anyway (Linux 32 bit)... big thank you to
Shesh who asked within IBM to have it added.

With kind regards,

Jeroen K

Mike

unread,
Jan 29, 2008, 8:25:30 AM1/29/08
to
On Jan 25, 3:25 pm, "Jeroen Keppens" <jeroen.kepp...@nmv.be> wrote:
> The version I needed isn't there anyway (Linux 32 bit)... big thank you to
> Shesh who asked within IBM to have it added.
>
> With kind regards,
>
> Jeroen K
>
> -----Original Message-----
> From: informix-list-boun...@iiug.org [mailto:informix-list-boun...@iiug.org]
>
> On Behalf Of Gerardo Santana
> Sent: vrijdag 25 januari 2008 17:07
> To: informix-l...@iiug.org

> Subject: Re: PHP & Informix on Red Hat Enterprise 5
>
> Art S. Kagel (Oninit LLC) wrote:
> > Jeroen Keppens wrote:
>
> > > Hi,
>
> > > I checked and I have CSDK.2.90.UC4.
>
> > > I can't find UC6 on the IBM site. Does anyone have the linux 32bit
> > > available that I can download?
>
> > This is like deja-vous all over again! The current release of the CSDK
> > is 3.00, you CAN download that release from the IBM site and that works
> > fine.
>
> I wouldn't blame Jeroen. I was confused the first time I tried to get
> the CSDK too (under Trials?, at a search result page? what the ...?)
>
> Jeroen, _if you can afford it_, try a real language, like Python or
> Ruby.
> _______________________________________________
> Informix-list mailing list
> Informix-l...@iiug.orghttp://www.iiug.org/mailman/listinfo/informix-list

I just got 5.2.5 working with apache 2 on aix, but it was a real bitch
to get built, it took like 2 days of hacking the configure script.
I'd build it from source if I were you. We used the CSDK 3.0

That said, you can build any pdo module into php statically (see the
php website for details), which is what we did for informix.

It's working with IDS 9.3, too, by the way.

M.

0 new messages