PHP Exceptions window not showing on throw

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

PHP Exceptions window not showing on throw

Postby jaywick » November 7th, 2013, 2:58 am

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
jaywick
 
Posts: 3
Joined: November 7th, 2013, 2:46 am

Re: PHP Exceptions window not showing on throw

Postby Miloslav Beno » November 7th, 2013, 12:09 pm

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,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: PHP Exceptions window not showing on throw

Postby jaywick » November 7th, 2013, 10:14 pm

Hi Miloslav, I've attached the log file. Thanks!
You do not have the required permissions to view the files attached to this post.
jaywick
 
Posts: 3
Joined: November 7th, 2013, 2:46 am

Re: PHP Exceptions window not showing on throw

Postby Miloslav Beno » November 8th, 2013, 3:01 pm

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,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: PHP Exceptions window not showing on throw

Postby jaywick » November 9th, 2013, 5:38 am

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!
jaywick
 
Posts: 3
Joined: November 7th, 2013, 2:46 am

Re: PHP Exceptions window not showing on throw

Postby Miloslav Beno » November 9th, 2013, 5:13 pm

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!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: PHP Exceptions window not showing on throw

Postby Miloslav Beno » November 12th, 2013, 4:04 pm

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,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 219 guests

User Control Panel

Login

Who is online

In total there are 219 users online :: 0 registered, 0 hidden and 219 guests (based on users active over the past 5 minutes)
Most users ever online was 487 on April 27th, 2024, 10:08 am

Users browsing this forum: No registered users and 219 guests