Solved

Linux-Informix-PHP Problem: pdo_informix

Posted on 2010-09-10
11
2,412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 34

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
Webinar: MongoDB® Index Types

Join Percona’s Senior Technical Services Engineer, Adamo Tonete as he presents “MongoDB Index Types, How, When and Where Should They be Used?” on Wednesday, July 12, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7).

 
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

Webinar: MongoDB® Index Types

Join Percona’s Senior Technical Services Engineer, Adamo Tonete as he presents “MongoDB Index Types, How, When and Where Should They be Used?” on Wednesday, July 12, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7).

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

691 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