Subject | Re: [firebird-php] Problems with PHP 5.3.3 on Gentoo Linux |
---|---|
Author | Matthias Hanft |
Post date | 2010-10-18T10:53:23Z |
Lester Caine wrote:
bugfixes against "plain vanilla" 5.3.3 may be applied). In any case,
it's marked as "stable" :-)
until here");' - and found out that ibase_connect seems to work;
with 'print_r($this->IBDatabaseAbrech);' I get "resource id#7" after
$this->IBDatabaseAbrech=ibase_connect("server:database", "user", "password", "latin1", 0, 3);
The PHP script crashes when executing
$trans=ibase_trans(IBASE_DEFAULT, $this->IBDatabaseAbrech);
Apache then writes
[Mon Oct 18 12:26:17 2010] [notice] child pid 17771 exit signal Illegal instruction (4)
into its logfile.
$trans=ibase_trans($this->IBDatabaseAbrech);
produces the same error, while
$trans=ibase_trans(); // how does it know which database to use?!
doesn't crash, but continuing the script like this:
$prep=ibase_prepare($trans, $stmt);
$res=ibase_execute($prep, strtoupper(trim($aUN)), strtoupper(trim($aPW)));
if ($row=ibase_fetch_assoc($res)) { // user found
$this->FKunde->SetFromSQL($row);
$this->FAccountId=intval($row['ACCOUNT_ID']);
} else { // nothing found
$this->FKunde->Clear();
$this->FAccountId=-1;
} // nothing found
ibase_free_result($res);
ibase_free_query($prep);
ibase_commit($trans);
}
doesn't return any records.
I now have found out that it *does* work if I leave out the transaction
completely, that is:
$prep=ibase_prepare($this->IBDatabaseAbrech, $stmt); // database instead of transaction!!
$res=ibase_execute($prep, strtoupper(trim($aUN)), strtoupper(trim($aPW)));
if ($row=ibase_fetch_assoc($res)) { // user found
$this->FKunde->SetFromSQL($row);
$this->FAccountId=intval($row['ACCOUNT_ID']);
} else { // nothing found
$this->FKunde->Clear();
$this->FAccountId=-1;
} // nothing found
ibase_free_result($res);
ibase_free_query($prep);
}
I guess this leads to an implicit transaction which is auto-committed at the
end of the PHP script (which is OK in this case), but I'd rather use explicit
transactions (and if changing all my PHP scripts to implicit transactions, I
would have to rewrite tons of code...)
Has the ibase_trans call changed with PHP 5.3? I have written my PHP code as
in http://de3.php.net/manual/en/function.ibase-trans.php ("User Contributed
Notes") - using ibase_prepare with the transaction, not the link identifier.
But when the transaction start already crashes...
-Matt
[Non-text portions of this message have been removed]
>Oh, it's not a "rc1", it's Gentoo's "5.3.3-r1" (relase 1 where some
> A point ... PHP5.3.3 has been released so you don't need the rc1 version.
bugfixes against "plain vanilla" 5.3.3 may be applied). In any case,
it's marked as "stable" :-)
> Probably the first question is does it actually fault on the connect orI now have inserted a lot of 'echo "I am here";' and 'exit ("works
> something later? Trying via ADOdb may give some more information, but
> basically
> it should work.
until here");' - and found out that ibase_connect seems to work;
with 'print_r($this->IBDatabaseAbrech);' I get "resource id#7" after
$this->IBDatabaseAbrech=ibase_connect("server:database", "user", "password", "latin1", 0, 3);
The PHP script crashes when executing
$trans=ibase_trans(IBASE_DEFAULT, $this->IBDatabaseAbrech);
Apache then writes
[Mon Oct 18 12:26:17 2010] [notice] child pid 17771 exit signal Illegal instruction (4)
into its logfile.
$trans=ibase_trans($this->IBDatabaseAbrech);
produces the same error, while
$trans=ibase_trans(); // how does it know which database to use?!
doesn't crash, but continuing the script like this:
$prep=ibase_prepare($trans, $stmt);
$res=ibase_execute($prep, strtoupper(trim($aUN)), strtoupper(trim($aPW)));
if ($row=ibase_fetch_assoc($res)) { // user found
$this->FKunde->SetFromSQL($row);
$this->FAccountId=intval($row['ACCOUNT_ID']);
} else { // nothing found
$this->FKunde->Clear();
$this->FAccountId=-1;
} // nothing found
ibase_free_result($res);
ibase_free_query($prep);
ibase_commit($trans);
}
doesn't return any records.
I now have found out that it *does* work if I leave out the transaction
completely, that is:
$prep=ibase_prepare($this->IBDatabaseAbrech, $stmt); // database instead of transaction!!
$res=ibase_execute($prep, strtoupper(trim($aUN)), strtoupper(trim($aPW)));
if ($row=ibase_fetch_assoc($res)) { // user found
$this->FKunde->SetFromSQL($row);
$this->FAccountId=intval($row['ACCOUNT_ID']);
} else { // nothing found
$this->FKunde->Clear();
$this->FAccountId=-1;
} // nothing found
ibase_free_result($res);
ibase_free_query($prep);
}
I guess this leads to an implicit transaction which is auto-committed at the
end of the PHP script (which is OK in this case), but I'd rather use explicit
transactions (and if changing all my PHP scripts to implicit transactions, I
would have to rewrite tons of code...)
Has the ibase_trans call changed with PHP 5.3? I have written my PHP code as
in http://de3.php.net/manual/en/function.ibase-trans.php ("User Contributed
Notes") - using ibase_prepare with the transaction, not the link identifier.
But when the transaction start already crashes...
-Matt
[Non-text portions of this message have been removed]