php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5656 ifx_pconnect : E [SQLSTATE=IX 001 SQLCODE=-1829]
Submitted: 2000-07-18 07:19 UTC Modified: 2004-08-20 23:10 UTC
From: marsu at europe dot com Assigned: danny (profile)
Status: Closed Package: Informix related
PHP Version: 4.0 Release Candidate 2 OS: Linux RedHat 6
Private report: No CVE-ID: None
 [2000-07-18 07:19 UTC] marsu at europe dot com
We have an Informix (7?) database on a separate machine, and PHP files on 3 other ones.
PHP is integrated as a module in Apache on our server.
The enterprise who made the developments are unable to solve the following problem, and were not clever enough to ask for information, so I have to do it myself, though I don't have (yet?) all the informations (especially conf files) I'd like to.

Our problem is, starting after a certain amount of time (or probably, connections), the ifx_pconnect() (and equally the ifx_connect()) functions return the following message:
E [SQLSTATE=IX 001 SQLCODE=-1829]
and refuses the connection.

When we restart the Apache server (start+stop, not restart) it *may* get better, but it is not always the case.
Our server may have up to 400 connections simultaneously, but the trouble appears before that limit is reached. Even counting closed connections.

We have had these problems with PHP 3.?.?, and the upgrade to version 4 didn't make any correction to this problem.

If you could help us on this, it'd be very helpful!!
Please do not hesitate to ask for some more information, as I know there is not enough here --but I don't have much more yet.
The services we provide may suffer from this problem, and as we pay the internet users for this, this would be a sad story for free internet usage!

Best regards, and thanks for the amazing wonderful work already done! I'll contribute asa I'll have more time for this.

Sorry for my bad english!

Dominique -- RDBMS manager and software engineer

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-21 01:12 UTC] danny at cvs dot php dot net
It looks like you have run out of file descriptors.

There are 2 things to consider :

1. If you use ifx_connect() instead of ifx_pconnect(), it is imperative to insure that every page does an ifx_close(), otherwise you will run out of connections (and file descriptors) very fast. Check "error handling" code for missing ifx_close()!

2. If you use ifx_pconnect(), you should not use ifx_close() at all, or you will defeat the purpose of persistent connections.
HOWEVER, when using ifx_pconnect(), you should never use the user id and password supplied by the user for database connections, because persistent connections are identified by the combination databasename/userid/password. So you could end up with hundreds or thousands of persistent connections depending on the number of users. ALWAYS use the same (or a few) user id (s) to connect to the database, and do your security and access permission checks on the application level (using the user id and password supplied by the user). This will let you control the number of simultaneous persistent connections to the database. Remember that each Apache process has it's own set of connections !

Danny
--

 [2000-08-27 18:08 UTC] sniper@php.net
Danny:  I assume you forgot to close this one?
If not please reopen with feedback.

--Jani
 [2000-10-02 20:10 UTC] marsu at europe dot com
Though this item was closed, I have to re-open it.
I still have the problem, which happens or doesn't happen, without any apparent reason.
We've opened a call with Informix support, which hasn't found anything yet.
We've tested 3.0.14 AND 4.0RC1 ; the trouble is still there.

We have tested Danny's proposed solution; the symptoms remain. Sometimes we can connect,
sometimes not.
Lastly I noticed that the "persistant" optin is set in httpd.ini file; so maybe the tests made
with ifx_connect() instead of ifx_pconnect() may not mean anything.

Anyway, in the ifx_close() doc, I read that it doesn't close the persistant opened connections.
Is this true? (I also tested with no call to ifx_close().)

I can't find a solution to this. Did something change in the code of ifx_connect in the 4.02 PHP
release??? maybe it could help, but I can't do it without knowing this.

TIA,
  marsu@europe.com
 [2000-10-03 03:58 UTC] danny@php.net
I really need the versions of :

- Informix Server (IDS 7.x, 2000, or SE 7.x ?)

- Informix ESQL/C or CSDK used to build modphp

Danny
---
 [2000-12-07 11:20 UTC] sniper@php.net
Reopen, if this still happens when using latest snapshot
from http://snaps.php.net/

--Jani
 [2004-08-20 01:04 UTC] SWISSWAP at BLUEWIN dot CH
ifx_pconnect  SQLCODE = -1829
=============================
I have developed a payment gateway that uses Informix Database. The gateway never reported database connection problem since it launched live in Aug. 2003. The gateway is running as a cgi (C and ESQL/C) on Apache httpsd. However, we have web-applications written in PHP which use the same database server and suffer from ifx_pconnect problem that mentioned in Bug 5656.

We have employed Informix specialists to check informix CSDK and other configuration stuffs. They have not found anything  wrong with configuration that may cause the connection problem.

I guess the problem is either with PHP informix module or PHP and Apache... Apache or PHP open/close operations with file handle are not consistent. 

I will appreciate if ideas about fixes or suggestions to get rid of the connection problem with PHP.
 [2004-08-20 23:10 UTC] marsu at europe dot com
The troubles i Had were solverd by removing the PHP 
module for Informix Database Access from the inner 
module of Apache. Said in another way, the problem was 
solved by deactivating the php inculded in Apache.
But I don't work in the entreprise I was in at that time 
since years, so I won't be able to help you much more :(

Hope this helps!
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Wed Nov 14 11:01:25 2018 UTC