Breakpoints not working with Custom WebService

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

Breakpoints not working with Custom WebService

Postby codeowl » July 15th, 2013, 8:47 am

Hi guys,

Today my breakpoints stopped working. They were working fine most of the day, then they just stopped getting hit.

I have restarted VS2012, no difference.
I have rebooted Windows 7 Ultimate , no difference.
I am using WAMP and everything has been working fine for some time, up until this afternoon.
Breakpoints get hit ok using the Lolcal IIS Express option.
I even tried creating a simple one page project with the following:

Code: Select all
<?php
echo phpinfo();
?>


I put a breakpoint on the echo phpinfo() line, but it does not get hit.
The page renders and here is what it shows for the xDebug part:

xdebug

xdebug support enabled
Version 2.2.1
IDE Key 1

Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $

Directive Local Value Master Value
xdebug.auto_trace Off Off
xdebug.cli_color 0 0
xdebug.collect_assignments Off Off
xdebug.collect_includes On On
xdebug.collect_params 0 0
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.coverage_enable On On
xdebug.default_enable On On
xdebug.dump.COOKIE no value no value
xdebug.dump.ENV no value no value
xdebug.dump.FILES no value no value
xdebug.dump.GET no value no value
xdebug.dump.POST no value no value
xdebug.dump.REQUEST no value no value
xdebug.dump.SERVER no value no value
xdebug.dump.SESSION no value no value
xdebug.dump_globals On On
xdebug.dump_once On On
xdebug.dump_undefined Off Off
xdebug.extended_info On On
xdebug.file_link_format no value no value
xdebug.idekey php-vs php-vs
xdebug.max_nesting_level 100 100
xdebug.overload_var_dump On On
xdebug.profiler_aggregate Off Off
xdebug.profiler_append Off Off
xdebug.profiler_enable Off Off
xdebug.profiler_enable_trigger Off Off
xdebug.profiler_output_dir \ \
xdebug.profiler_output_name cachegrind.out.%p cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_connect_back Off Off
xdebug.remote_cookie_expire_time 3600 3600
xdebug.remote_enable On On
xdebug.remote_handler dbgp dbgp
xdebug.remote_host localhost localhost
xdebug.remote_log no value no value
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
xdebug.scream Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars Off Off
xdebug.show_mem_delta Off Off
xdebug.trace_enable_trigger Off Off
xdebug.trace_format 0 0
xdebug.trace_options 0 0
xdebug.trace_output_dir \ \
xdebug.trace_output_name trace.%c trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 3 3


Here is my php.ini options:
; XDEBUG Extension
zend_extension = "c:\wamp\bin\php\php5.4.3\ext\php_xdebug-2.2.1-5.4-vc9.dll"
[xdebug]
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_mode = req
xdebug.idekey="php-vs"


What could have happened?

How can I get this working again?

Regards,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: Breakpoints not working with Custom WebService

Postby Miloslav Beno » July 15th, 2013, 3:15 pm

Hi Scott,

the settings looks ok.

Could you please try to setup xdebug.remote_log option so we can check what's happening with xdebug?

What about firewall? isn't it possible that it blocks connection? You can try to change port from 9000 (in vs and in php.ini) if it would make any difference.

Thanks
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Breakpoints not working with Custom WebService

Postby codeowl » July 16th, 2013, 12:15 am

Miloslav,

Thanks for getting back to me so quick.

Ok the project has one page: index.php

Code: Select all
<html>
<body>

<?php

echo phpinfo();

?>

</body>
</html>


The Project Properties are set to Custom Web Server:
Server URL: http://localhost/PHPTestSite/PHPTestSite/
And the Start Action is Specific Page: index.php

When I Play the project, the page renders perfectly with the URL: http://localhost/PHPTestSite/PHPTestSit ... ON_START=1

But the breakpoint I have on the echo line doesn't get hit.

The xDebug log is as follows:

Code: Select all
Log opened at 2013-07-16 00:01:00
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/wamp/www/PHPTestSite/PHPTestSite/index.php" language="PHP" protocol_version="1.0" appid="3128" idekey="1"><engine version="2.2.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]></copyright></init>

<- breakpoint_set -i x0-10000 -t exception -x "Fatal error"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="x0-10000" id="31280001"></response>

<- breakpoint_set -i x1-10001 -t exception -x "Parse error"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="x1-10001" id="31280002"></response>

<- breakpoint_set -i x2-10002 -t exception -x "Unknown error"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="x2-10002" id="31280003"></response>

<- feature_get -i 3 -n max_children
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="3" feature_name="max_children" supported="1"><![CDATA[32]]></response>

<- breakpoint_set -i 4-0 -t line -f file://C:/wamp/www/PHPTestSite/PHPTestSite/index.php -n 17
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="4-0" id="31280004"></response>

<- run -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="5" status="stopping" reason="ok"></response>

Log closed at 2013-07-16 00:01:00


Also I cleared the log file, tried turning off the Firewall (only have windows 7 default firewall), and then loading the page again, but no difference. Got the same error as above.

Regards,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: Breakpoints not working with Custom WebService

Postby codeowl » July 16th, 2013, 12:37 am

Miloslav,

I have it sorted mate. I saw there was a newer version of xDebug out than what I was using, and I went to their Tailored Installation Instructions page: http://xdebug.org/wizard.php

When I ran the wizard it gave me the following warning:

Warning: You seem to have Xdebug loaded as a normal PHP extension only. This will cause odd issues, please see the FAQ entry on it.


So I searched my php.ini for "xdebug" and found that the problem was, when I initially ran into issues with my breakpoint not getting hit, I clicked on the WAMP icon and went to:
WAMP/PHP/PHP Extensions/
and in there I saw php_xdebug was not ticked. So it attempted to tick it a number of times. Each time it would restart the apache service, but when I went back to check, the tick I had set was not there.

Looking at my php.ini today I noticed that in the Windows Extensions section, it had put in the following entries each time I tried to tick the option:

extension=php_xdebug-2.2.1-5.4-vc9.dll
extension=php_xdebug-2.2.1-5.4-vc9.dll
extension=php_xdebug-2.2.1-5.4-vc9.dll
extension=php_xdebug-2.2.1-5.4-vc9.dll
extension=php_xdebug-2.2.1-5.4-vc9.dll
extension=php_xdebug-2.2.1-5.4-vc9.dll


I removed these, and now my breakpoints are getting hit.

Apparently it is normal for the WAMP/PHP/PHP Extensions/php_xdebug.... option to be unticked. This is probably because it is loaded as a zend extension and they do not show in the PHP Extensions list.
When I look in WAMP/PHP/PHP Settings/(XDebug) Remote Debug is ticked.

Hopfully this will help any other WAMP users with similar issues ;-)

I think I will still upgrade xDebug to the latest version.

Thanks again for responding ;-)

Regards,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: Breakpoints not working with Custom WebService

Postby Miloslav Beno » July 18th, 2013, 10:57 am

Scott,

Great! Glad you got it working and sharing the solution with us!

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 27 guests

cron

User Control Panel

Login

Who is online

In total there are 27 users online :: 0 registered, 0 hidden and 27 guests (based on users active over the past 5 minutes)
Most users ever online was 297 on March 29th, 2024, 7:06 am

Users browsing this forum: No registered users and 27 guests