ID:               5656
 Comment by:       SWISSWAP at BLUEWIN dot CH
 Reported By:      marsu at europe dot com
 Status:           Closed
 Bug Type:         Informix related
 Operating System: Linux RedHat 6
 PHP Version:      4.0 Release Candidate 2
 Assigned To:      danny
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2000-12-07 11:20:20] [EMAIL PROTECTED]

Reopen, if this still happens when using latest snapshot
from http://snaps.php.net/

--Jani

------------------------------------------------------------------------

[2000-10-03 03:58:00] [EMAIL PROTECTED]

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-10-02 20:10:09] 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,
  [EMAIL PROTECTED]

------------------------------------------------------------------------

[2000-08-27 18:08:40] [EMAIL PROTECTED]

Danny:  I assume you forgot to close this one?
If not please reopen with feedback.

--Jani

------------------------------------------------------------------------

[2000-07-21 01:12:40] 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
--


------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/5656

-- 
Edit this bug report at http://bugs.php.net/?id=5656&edit=1

Reply via email to