NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
PHP 5 Exceptions


Joined: 15 Apr 2008
Posts: 2
Reply with quote
I started on a project that will use exceptions. When the DBG extension is installed an exception is not returned, only a blank screen. When not installed the exception is displayed as expected. I have sent this problem to support 2 times and have not had a reply. My testing server is as follows

Linux 2.6.22
Apache 2.0
PHP 5.2.3-1ubuntu6.3
Debugger dbg.so-5.2.x

Here is the code I used for testing

Code:
<?php
class NewException extends Exception
{
    public function __construct($message, $code=NULL)
    {
        parent::__construct($message, $code);
    }

    public function __toString()
    {
        return "Code: " . $this->getCode() . "<br />Message: " . htmlentities($this->getMessage());
    }

    public function getException()
    {
        print $this; // This will print the return from the above method __toString()
    }

    public static function getStaticException($exception)
    {
         $exception->getException(); // $exception is an instance of this class
    }
}

set_exception_handler(array("NewException", "getStaticException"));
throw new NewException("Catch me!!!", 69);
View user's profileFind all posts by RickabSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
I'm sorry for the delay.

Your sample works fine for me.
Please make sure that correct debugger module is installed.
We provide 4 modules for linux platform:
x86 glibc 2.3+
x86 glibc 2.7+
x86_64 glibc 2.3+
x86_64 glibc 2.7+

which one did you install?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 15 Apr 2008
Posts: 2
Reply with quote
I do not see any files like that with the PhpEd install I have. Only dbg-3.2.2-Linux and I have installed Debugger dbg.so-5.2.x as per the server configuration I have above.
View user's profileFind all posts by RickabSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
When the DBG extension is installed an exception is not returned, only a blank screen.

I'm not sure what you expect from the exceptions and why they would need to be "returned" to somewhere.
In general, if not caught, they produce regular php error which may be sent to the client browser and may not, depending on the php settings. Debugger has no relation to this process. Just make sure that you have the most recent one installed (which is 3.2.14 at the moment) .

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
PHP 5 Exceptions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic