Re: Getting PHP on XP Pro to communicate with an Informix Server

From: D Sandmann (CrackerDog22_at_yahoo.com)
Date: 10/20/03


Date: Mon, 20 Oct 2003 12:09:20 -0000

I finally figured it out, thanks in part to Jonathan. And I thought I
would pass this along to anyone else that is interested in knowing what
happened. These are the lines I had prior to Jonathans posting:

            SetEnv INFORMIXDIR "C:\Program Files\Informix\Client-SDK"
            SetEnv INFORMIXSERVER "server_name"
            PassEnv INFORMIXSERVER
            PassEnv INFORMIXDIR

            LoadModule php4_module modules/php4apache2.dll
            AddType application/x-httpd-php .php

After reading his posting, I then commented out the PassEnv lines and
restarted Apache. Once restarted, the php script worked.

I just assumed, pays to read docs, that PassEnv ment to pass the
environment variable just set to any additional programs that you run.
But I have to assume that Apache got confused with these four statements,
and did not know what to do. For now I have to assume this might be a bug
with Apache. Anyways, it worked without the PassEnv, that's all I care
about for now.

Thanks for everyones help!

David

Jonathan Leffler <jleffler@earthlink.net> wrote in
news:QQ5kb.1497$np1.722@newsread3.news.pas.earthlink.net:

> D Sandmann wrote:
>
>> The following is the system I am currently using to communicate with
>> an Informix Server:
>>
>> System: Windows NT DAVIDS 5.1 build 2600 (XP Professional)
>> Apache Version: Apache/2.0.47 (Win32) PHP/4.3.3
>>
>> I have the following line in a PHP file:
>> $db = ifx_connect ("db@server", "username", "passwd");
>>
>> When I try to access the page that contains this I get the following
>> error message, same when I used ifx_pconnect():
>>
>> Warning: ifx_connect(): E [SQLSTATE=IX 001 SQLCODE=-1829] in
>> C:\webroot\index.php on line 9
>>
>> Which the -1829 translates to:
>>
>> Cannot open file citoxmsg.pam.
>>
>> The file citoxmsg.pam is missing from the directory
>> $INFORMIXDIR/msg.
>>
>> When I look in that directory the file does exist. My informix
>> directory is in C:\informix. My System variables has the INFORMIXDIR
>> pointing to C: \Informix.
>>
>> I am running INFORMIX-ESQL Setnet32 Utility 9.21 2.30.TC1
>
> Apache has a habit of unsetting most environment variables - do you
> know whether you actually have $INFORMIXDIR set when the PHP code is
> run? On Unix, you have to worry about a SetEnv INFORMIXDIR
> /where/you/put/it directive on the Apache httpd.conf file, for
> example.
>