Solved

Linux-Informix-PHP Problem: pdo_informix

Posted on 2010-09-10
11
2,279 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 32

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 61

Expert Comment

by:gheist
ID: 33667867
can you use dbaccess as apache account?
0
 
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 61

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 61

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 61

Expert Comment

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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now