Re: PHP & Informix on Red Hat Enterprise 5
Posted in 2008
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
On Jan 23, 2008 9:33 AM, Jeroen Keppens <jeroen.keppens@nmv.be> wrote:
> 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
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
>