Re: PHP & Informix on Red Hat Enterprise 5
Posted in 2008
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
On 23 Jan 2008, at 09:45, Paul Watson (Oninit LLC) wrote:
> Trying building the PHP from source BUT the last time I look at this
> the
> informix pdo was not allowed - invalid option
>
> Cheers
> Paul
>
> Jeroen Keppens 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
>
>