Consultor Eletrônico



Kbase P6841: SQL-89 ODBC connection fails through PHP program with error unable to open PROMSGS file:
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/22/2005
Status: Unverified

SYMPTOM(s):

SQL-89 ODBC connection fails through PHP program with error unable to open PROMSGS file:

[MERANT][ODBC progress driver]msgOpen:unable to open message file:PROMSGS.

Warning: SQL error: [MERANT][ODBC PROGRESS driver]msgOpen: unable to open message file: PROMSGS, SQL state S1000 in SQLConnect in <app>.php on line

msgOpen: unable to open message file: PROMSGS, SQL state S1000 in SQLConnect in <app>.php on line

Using SQL-89

CAUSE:

It is necessary to have a client networking installation and DLC,PROMSGS,IDLC and IPROMSGS environments variable defined on the PHP machine.

FIX:

1) To confirm that these variables are defined the following instruction can be used on a .php file:
<?php echo $DLC; $PROMSGS; $IDLC; $IPROMSGS; ?>
or
<?php phpinfo(); ?>

with this instruction a long page will be shown with all the information about the machine including the Environment variables.

2) To define the variables if they are not already defined it can be done:

-On the machine at the O.S. level in the system environmental variables for Windows NT/2000 or exporting them in Unix.

-On the PHP application through the PHP putenv command:
<?php
putenv("DLC=...");
putenv("PROMSGS...");
putenv("IDLC....");
putenv("IPROMSGS...");
?>

Notes about putenv:
The environment variable will only exist for the duration of the current request.
In Safe Mode, the user may only alter environment variables whose names begin with the prefixes supplied by the safe_mode_allowed_env_vars directive and not supplied in the safe_mode_protected_env_vars directive.