2

It seems PHP 7 changed a bit the way to work with the Interbase module.

Same code on PHP 5.6 works flawlessly.

If you have one open link to an Interbase/Firebird database and you open another one to the same database the first link it's closed.

One example of code can be:

$conx = ibase_pconnect(DB_HOST . ":" . DB_NAME,DB_USER,DB_PWD,DB_CHARACTER) or die(ibase_errcode() . ' ' . ibase_errmsg()); 

$conx2 = ibase_pconnect(DB_HOST . ":" . DB_NAME,DB_USER,DB_PWD,DB_CHARACTER) or die(ibase_errcode() . ' ' . ibase_errmsg()); 

$sql = 'SELECT something from somewhere';

$query = ibase_query($conx, $sql);

while ($row = ibase_fetch_assoc($query)) {
    echo $row['something'];
}

DB_xxx are defined variables with the users, password, ..... of the database.

The result it's the same if instead of ibase_pconnect we write ibase_connect

If you run that code you won't get nothing, and on the page log you will see something like:

supplied resource is not a valid Firebird/InterBase link resource in ....

ibase_fetch_assoc(): Dynamic SQL Error SQL error code = -504 Invalid cursor reference Cursor is not open ....

If we remove the line with the $conx2 all will work perfectly.

On my php.ini I have this (exactly the same than on PHP 5.6):

ibase.allow_persistent = 1

; Maximum number of persistent links.  -1 means no limit.
ibase.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
ibase.max_links = -1

Interbase module for php7 has a new option which it's generating this problem ?

4

1 回答 1

0

这是一个 php-7.0 错误。

如果前段时间在版本 7.2.16 上已修复,并且在较低版本中也已修复。

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

于 2016-06-28T08:42:51.347 回答