Bug #72175 [Com]: Impossibility of creatiing multiple connections to Interbase with php 7.0

From: Date: Mon, 07 May 2018 19:39:40 +0000
Subject: Bug #72175 [Com]: Impossibility of creatiing multiple connections to Interbase with php 7.0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215148@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72175&edit=1

 ID:                 72175
 Comment by:         ucijas at gmail dot com
 Reported by:        netvicious at gmail dot com
 Summary:            Impossibility of creatiing multiple connections to
                     Interbase with php 7.0
 Status:             Open
 Type:               Bug
 Package:            InterBase related
 Operating System:   Ubuntu 16.04 LTS
 PHP Version:        7.0.6
 Block user comment: N
 Private report:     N

 New Comment:

I can confirm this also in CentOS 6.9 compiling 7.1.17 via github as of today:

Any sub-call to another function which also calls ibase_connect() will break the
parent-function's previous ibase connection.

I could theoretically get around it sometimes by creative SQL joins or storing in arrays, if
projects were small, but we way too much legacy code to do that, and it would ultimately spaghettify
our code anyway.

Thus -- as indicated by "us at menatwork dot de" on 2017/07/12 -- this a complete
dead-in-water deal-breaker for PHP 7+ w/Firebird and, until fixed, there really should be prominent
warnings put out (home page, changelog, release notes, and compilation script) that PHP 7+ does not
work with Firebird and not to waste folks' time.

Let me know if I can be of any help. I may be able to look at the code later, but my C++ is rusty
and I am now up against deadlines, so this keeps us at 5.6.

See also Bug #14039 (https://bugs.php.net/bug.php?id=14039). Seems to have existed for a while back
2002, as well, then was fixed, then popped up again in 2017. (Might be related?)

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2017-12-04 16:17:22] buhlerax@php.net

Good afternoon,
Does anyone have any news about this bug?
I use Debian Jessie with php 7.0, 7.1 and the same situation happens.

------------------------------------------------------------------------
[2017-11-10 11:50:27] netvicious at gmail dot com

I sent a comment to the Firebird dev mailing list but anybody looked at this bug. 

As I said my workaround was to use a static var on the database access library I include on all the
php files which use BDs.

class ps_DB {

...

private static $conn = 0;

function connect() { 

	if (self::$lid == 0) {
		self::$lid = ibase_pconnect(DB_HOST . ":" . DB_NAME,DB_USER,DB_PWD,DB_CHARACTER);

...

Using this static variable we will use always the same BD connection and it will work.

------------------------------------------------------------------------
[2017-11-10 10:03:26] roman dot vanicek at gmail dot com

There is a workaround. One can use one database handle obtained from ibase_connect and then multiple
transaction handles obtained from ibase_trans.

------------------------------------------------------------------------
[2017-07-12 10:36:43] us at menatwork dot de

I think, nobody wants to repair this, so Firebird with PHP is dead.

------------------------------------------------------------------------
[2017-07-10 20:33:55] fabricio dot th2 at gmail dot com

Hello,

This bug is still present in version 7.2-alpha3 for Windows and Debian;

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


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

    https://bugs.php.net/bug.php?id=72175


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


Thread (32 messages)

« previous php.bugs (#215148) next »