[Stackoverflow] [Progress OpenEdge ABL] PHP script to query unixODBC uses incorrect UTF-8 settings when called from browser but works correctly from L

Status
Not open for further replies.
K

Kurt Ehrler

Guest
We are attempting to use PHP to interface with Progress databases to insert, retrieve, update and delete character strings in a variety of languages using PHP. Here's what does work:

  1. We can connect using unixODBC and isql and run an update script to update a field with unicode characters and it works fine.
  2. Run a php script from a command line that will run an update script to update a field with unicode characters that that works fine too.
  3. If we have a webserver call the exact same PHP script from 2) above, it updates the record in the table with values that would be an extra encoding of the unicode. There was a known issue with unixODBC that used to do double encoding of unicode values and the version of the platform we're working on originally had an older version of the driver that had the problem. We installed newer unixODBC drivers that do not have the problem (2.3.9 I believe) and now the isql and command line PHP work properly as a result. What we suspect is that the the web server is still using the older version of unixODBC even though we've attempted to ensure it uses the environment variables we've set for LD_LIBRARY_PATH, ODBCINI and ODBCINST by adding those definitions as part of the httpd for Apache.

I had hoped that the solution listed as Edit3Solution on this question Cannot Connect to informix through ODBC on linux machine would be what resolved things for me, but we already had taken the step of adding our environment variables to httpd but no dice.

Code:
In the phpinfo from a browser, we see:
Apache Environment
Variable    Value
LD_LIBRARY_PATH /usr/lib:/dr01/repository/lib:/qad/progress/dlc11264/lib
ODBCINST    /etc/odbcinst.ini
ODBCINI /etc/odbc.ini

But we also see:

Code:
ODBC 
Support enabled
Active Persistent Links 0
Active Links    0
ODBC library    unixODBC
ODBC_INCLUDE    -I/usr/include
ODBC_LFLAGS -L/usr/lib64
ODBC_LIBS   -lodbc

To try to get around this, we attempted to set virtual paths to the odbc relevant code in the /usr/lib64 directory to the /usr/lib directory for just the odbc related files.

So far no luck. The behavior is the same. Is it possible that the Apache server has it's own unixODBC that it uses when it calls PHP and ignores the unixODBC we've defined on the server?

Continue reading...
 
Status
Not open for further replies.
Top