Page 1 of 1

PHP Exceptions window not showing on throw

PostPosted: November 7th, 2013, 2:58 am
by jaywick
I'm trying to get the Exception message window to show as shown on the Facebook page:

Image

But I don't seem to be able to get it to show.

I've ticked all the PHP exceptions in the Debug > Exceptions window and followed the instructions at http://www.devsense.com/doc/phptools/de ... leshooting. Note that I can debug by stepping through the code and seeing their values just fine, it's just that I don't see the Exception popup.

I am on Visual Studio 2012 and PHP Tools for VS 1.8.4704 running on Windows 8 32bit.

This code for me does not show up an Exception message. Can anyone else confirm this should show the Exception popup message? I just see 'start' printed and that's it.

Code: Select all
<?php
echo 'start';
throw new Exception("broken");
echo 'end';
?>


Any help would be appreciated! Thanks :P

Re: PHP Exceptions window not showing on throw

PostPosted: November 7th, 2013, 12:09 pm
by Miloslav Beno
Hi Jay,

Thanks for the post!

In the sample code you've submitted you should get exception message even if nothing is checked in Debug Exception dialog. As unhandeled exception is considered Fatal error.

Could you please alter your php.ini by adding this:
xdebug.remote_log = PATH_TO_LOG. Save, restart the server.

Run the script and send the log file. We'll be able to identify what's happening.

Thanks,

Re: PHP Exceptions window not showing on throw

PostPosted: November 7th, 2013, 10:14 pm
by jaywick
Hi Miloslav, I've attached the log file. Thanks!

Re: PHP Exceptions window not showing on throw

PostPosted: November 8th, 2013, 3:01 pm
by Miloslav Beno
Hi Jay,

Thank you so much for log! From it I can see you are debugging this file [url]file:///C:/Users/Jay/Desktop/test_php-deleteme/PHPWebProject1/PHPWebProject1/index.php[/url]

and that PHP Tools sets everything well for exceptions to be thrown. But the script just completes without breaking.

The file is exactly the same as you've posted above? If you put breakpoint on second line with
Code: Select all
echo 'start';

Does it break?

If you want we can make online session. If you are interested give me know I'll send you instructions.

Thanks,

Re: PHP Exceptions window not showing on throw

PostPosted: November 9th, 2013, 5:38 am
by jaywick
Yes the file is exactly as what I pasted above (a throw with two echoes around it).

The following lines break as expected when a breakpoint is set on them:

Code: Select all
echo 'start';
throw new Exception("broken");


but not for this one:

Code: Select all
echo 'end';


Stepping into the line with the 'throw' simply stops the debugging.

If you want we can make online session. If you are interested give me know I'll send you instructions.


Sure, this sounds good!

Re: PHP Exceptions window not showing on throw

PostPosted: November 9th, 2013, 5:13 pm
by Miloslav Beno
Jay,

Stepping into the line with the 'throw' simply stops the debugging.


This should stop script execution of the script as it's unhandled exception,but VS should throw exception window.

Could you please send also your php.ini and phpinfo() output? There might be some settings responsible for this.

Anyway I'll send you private message about the direct session.

Thanks!

Re: PHP Exceptions window not showing on throw

PostPosted: November 12th, 2013, 4:04 pm
by Miloslav Beno
This was caused by this directive in php.ini:

Code: Select all
xdebug.default_enable=0


Commenting this out, or just changing the value to 1 solves it.

Thanks,