My script PHP
is not receiving the exceptions
message that is generated by Firebird
. I have a class that connects to DB, runs sql, and disconnects.
By debugging the script, I saw that exception
is being generated because the script is broken, but the message is not being received by PHP
. To receive exception
I'm using ibase_errmsg()
. The function of the class that is responsible for executing sql
is this:
function sql($host, $user, $pass, $query, $charset){
$this->connect($host, $user, $pass, $charset);
if ($this->conectou) {
try {
if ($this->result=ibase_query($query)){
$this->disconnect($type);
return $this->result;
} else {
$errmsg = ibase_errmsg();
//Debug
echo $errmsg; //Nada esta mostrando aqui!!!
$this->disconnect($type);
throw new Exception($errmsg);
}
}
catch (Exception $e) {
echo $e->getMessage();
}
}
}
At first I thought the problem might be in ibase_errmsg()
, but most intriguing is that running the same script with Apache, the exception is normally displayed.
- Server: Debian
- Firebird: 2.5 superclassic
- Web Server: Nginx
- PHP: 5.4.45
- PHP process: php-fpm