Solved

Linux-Informix-PHP Problem: pdo_informix

Posted on 2010-09-10
11
2,355 Views
Last Modified: 2015-02-18
After a lot of struggles, I managed to install, php with apache on a Linux Ubuntu server and Informix.

When I create the file db2.php to create a database connection to Informix then I get the following message:


"SQLSTATE=HY000, SQLDriverConnect: -23101 [Informix][Informix ODBC Driver][Informix]Unspecified System Error = -23101"

I have been "pulling my hair" for some hours :-) Hopefully any of you folks have run into something similar and have some thoughts.

Thanks!
0
Comment
Question by:ckercher
11 Comments
 
LVL 33

Expert Comment

by:ste5an
ID: 33652548
What have you installed?

  http://forums.gentoo.org/viewtopic.php?t=245249

How do you try to connect to your Informix database?

  http://php.net/manual/en/function.odbc-connect.php


mfG
--> stefan <--
0
 
LVL 7

Expert Comment

by:jhp333
ID: 33655347
You can use "finderr 23101" command to see the detailed error message.

The following is the details of Informix error 23101:
-23101  Unable to load locale categories.

An invalid locale name was supplied for the locale initialization.
The environment variable specifying the locale category has a wrong
value.

Check the value of the corresponding environment variable,
CLIENT_LOCALE or DB_LOCALE. If this error was encountered when using
the "SET COLLATION" statement, check that the value passed to the
statement is a valid locale. If this error was encountered when using
the "SET NO COLLATION" statement, check that the session's default
locale file is still available. Also check if INFORMIXDIR points to
a valid directory where IBM Informix products are installed.  

If a client application receives this error when it requests a database
server connection, check that the client and database locales are
compatible. They are compatible if a valid locale exists on the server
computer with the name lg_tr.codeset@mod, where lg_tr (language and
territory) and mod (locale modifier) are from the CLIENT_LOCALE and
codeset is from the database locale (from the DB_LOCALE, if it is set,
or as stored in the database).
------------------------------------------------------

You may need to read Informix GLS User's guide:
http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.glsug.doc/glsug.htm
0
 
LVL 62

Expert Comment

by:gheist
ID: 33667867
can you use dbaccess as apache account?
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 4

Expert Comment

by:jlar310
ID: 33674330
The error you reference is typical of a missing INFORMIXDIR environment variable. This variable must be set in the environment of the apache process.

I have this working on CentOS. CentOS puts some general configuration files in /etc/sysconfig. I believe the equivalent for Ubuntu would be /etc/default.

In my /etc/sysconfig/httpd (Ubuntu = /etc/default/apache2) I have

export INFORMIXDIR=/path/to/your/informix
export INFORMIXSERVER=yourinformixservername

Ubunutu uses /bin/sh to launch apache as opposed to /bin/bash for CentOS, so you may need a different syntax to export the environment variables.

Then in your apache configuration you need

PassEnv INFORMIXDIR INFORMIXSERVER




0
 

Author Comment

by:ckercher
ID: 33703629
Thank you all for your comments/contributions.

My variables are set properly. These are the values for those variables in the odbc.ini file:

CLIENT_LOCALE=en_us.8859-1
DB_LOCALE=en_us.8859-1

According to the Informix tech support folk, the connection should be established. But it isn't. So, I am still looking for some assistance on this matter!

Thanks a lot!

Ysais.

0
 
LVL 62

Expert Comment

by:gheist
ID: 33715817
ODBC.INI has no influence on pdo_informix
try running ldd against pdo_informix, maybe you informixdir contains old software...
0
 

Author Comment

by:ckercher
ID: 33746775
All the software seems to up to date but nothing yet. According to the IBM support people it has to do with environment variables but all my variables are properly set. I am still into this error message. Thank you folks for your comments and I appreciate any further comments.
0
 
LVL 62

Expert Comment

by:gheist
ID: 33768411
try checking phpinfo() if all your variables are really set ;)
0
 

Accepted Solution

by:
ckercher earned 0 total points
ID: 34658336
With the help of IBM technical support, we were able to solve the problem.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40610717
http:#a33674330 is first that explains everything.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question