Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324803

Summary: While remote debugging php application on Linux(xdebug) from windows 7 using Eclipse PDT breakpoints are ignored. seems like mapping doesn't work
Product: z_Archived Reporter: Dmitry <dimontius>
Component: PDTAssignee: PHP Debug <php.debug-inbox>
Status: CLOSED INVALID QA Contact: Ilina Stefanova <ilina.s>
Severity: normal    
Priority: P3 CC: kalin.a
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Dmitry CLA 2010-09-08 17:53:32 EDT
Build Identifier: 20100617-1415

Xdebug and eclipse seem to be configured, and debug window shows that remote launch is established. But breakpoints in files located on my local machine are skipped. Also i can't make it work with "break at first line option", it doesn't give me the ability to navigate through code using F5, F6.

Reproducible: Always

Steps to Reproduce:
I have web application on the linux server, with xdebug configured. On the page output using phpinfo() i can see xdebug section. in php.ini i configured the xdebug.remote_host=93.72.xxx.xxx (my ip)

Source files on the server are located in /home/www/balado_web
Source files on the local machine are located in D:\WebServers\home\adyax\balado

Following settings where set in Eclipse PDT:
In the debug configuration tab:
  Server debuger: xDebug
  PHP server: (created new)
    name: balado
    url: http://mysite.com
    -----------------
    path mapping tab
      path on server: /home/www/balado_web
      Local path: D:\WebServers\home\adyax\balado

Then when i run debug, application starts with following url http://mysite.com/index.php?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=12839818070937

in debug window i can see the following structure:
  --balado[PHP Web Page]
    --PHP Applocation
      --Remote Launch

seems like eclipse is connected to xdebug, but when i put a breakpoint in the index.php(file from D:\WebServers\home\adyax\balado) it's being skipped :(

if i tick "break at first line" checkbox nothing happens at first load, but when i refresh the page i get the following structure in debug window:
  --balado[PHP Web Page]
    --PHP Applocation
      --Remote Launch (Stepping)

but i still can't go through the code using F5,F6 to debug it :(

I guess that it's something wrong with mapping end eclipse doesn't know which file to use. :(

Please help! Need to debug Drupal with Solr search.
Comment 1 David Kelsey CLA 2010-09-09 06:29:55 EDT
Break at first line doesn't make use of path mapping so that should work irrespectively.

If you don't get a stack frame display then I am not convinced that communication has been established. Does it say at the bottom "waiting for initial session" ?

Some things to try.
1. read through http://www.eclipse.org/pdt/documents/XDebugGuideForPDT2.0.pdf
2. obtain an xdebug log file
3. Your path mapping is not the usual way to do things. The best way is to have the php files in a php project in your pdt workspace. Then you would create a launch with the initial script being your index.php file (as this is the script that will be executed when the URL is invoked). Delete that path mapping from your server definition as PDT will generate one automatically based on the script that is executed and the script you provided in the launch configuration.
Comment 2 Dmitry CLA 2010-09-09 07:23:41 EDT
I removed mapping as you suggested. Now when i launch debugging process stuck at 57% please see screenshot http://ipicture.ru/uploads/100909/N2v19ztUtW.png.

I don't have log file. here is settings from phpinfo xdebug section

but i checked and noticed that folder for log file /var/log/apache/xdebug_remote actually doesn't exist, admin didn't create it. can it be the source of the problem?

xdebug support	enabled

Version 	2.0.5

Supported protocols	Revision

DBGp - Common DeBuGger Protocol 	$Revision: 1.125.2.6 $
GDB - GNU Debugger protocol 	        $Revision: 1.87 $
PHP3 - PHP 3 Debugger protocol  	$Revision: 1.22 $
 
Directive	                 Local Value	Master Value
xdebug.auto_trace	             Off	Off
xdebug.collect_includes               On	On
xdebug.collect_params	               0	0
xdebug.collect_return	             Off	Off
xdebug.collect_vars	             Off	Off
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	              Off	Off
xdebug.idekey	                     root	no value
xdebug.manual_url      http://www.php.net	http://www.php.net
xdebug.max_nesting_level	      100	100
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	/var/log/xdebug	/var/log/xdebug
xdebug.profiler_output_name	cachegrind.out.%t	cachegrind.out.%t
xdebug.remote_autostart	             Off	Off
xdebug.remote_enable	              On	On
xdebug.remote_handler	            dbgp	dbgp
xdebug.remote_host	    93.72.xxx.xxx	93.72.xxx.xxx
xdebug.remote_log	/var/log/apache/xdebug_remote	/var/log/apache/xdebug_remote
xdebug.remote_mode	              req	req
xdebug.remote_port	             9000	9000
xdebug.show_exception_trace	      Off	Off
xdebug.show_local_vars	              Off	Off
xdebug.show_mem_delta	              Off	Off
xdebug.trace_format	                0	0
xdebug.trace_options	                0	0
xdebug.trace_output_dir              /tmp	/tmp
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

(In reply to comment #1)
> Break at first line doesn't make use of path mapping so that should work
> irrespectively.
> 
> If you don't get a stack frame display then I am not convinced that
> communication has been established. Does it say at the bottom "waiting for
> initial session" ?
> 
> Some things to try.
> 1. read through http://www.eclipse.org/pdt/documents/XDebugGuideForPDT2.0.pdf
> 2. obtain an xdebug log file
> 3. Your path mapping is not the usual way to do things. The best way is to have
> the php files in a php project in your pdt workspace. Then you would create a
> launch with the initial script being your index.php file (as this is the script
> that will be executed when the URL is invoked). Delete that path mapping from
> your server definition as PDT will generate one automatically based on the
> script that is executed and the script you provided in the launch
> configuration.
Comment 3 David Kelsey CLA 2010-09-09 07:29:10 EDT
Your server is not contacting the ide. The most likely cause is your entry
xdebug.remote_host=93.72.xxx.xxx

which is not a valid ip address.

go to http://www.xdebug.org for information on how to configure xdebug on your server. Also please read the xdebug guide which I provided a link for in my original comment.

If no log is created and you do expect one then it means xdebug has not contacted the ide for some reason. 

Regards
Comment 4 Dmitry CLA 2010-09-09 07:37:10 EDT
Sorry for confusing you with my ip. i replaced last numbers... it's looks like this 
xdebug.remote_host    93.72.140.147    93.72.140.147

and i checked that pdf you mentioned before writing here. i tried all kinds of settings. Local debugging works perfectly. But i can't do anything with remote one :(

Thank you Dave

(In reply to comment #3)
> Your server is not contacting the ide. The most likely cause is your entry
> xdebug.remote_host=93.72.xxx.xxx
> 
> which is not a valid ip address.
> 
> go to http://www.xdebug.org for information on how to configure xdebug on your
> server. Also please read the xdebug guide which I provided a link for in my
> original comment.
> 
> If no log is created and you do expect one then it means xdebug has not
> contacted the ide for some reason. 
> 
> Regards
Comment 5 David Kelsey CLA 2010-09-09 07:48:08 EDT
If you cannot get an xdebug log, and the ide is waiting for initial xdebug session, then the problem really is that the server cannot contact the ide. The log is created once a socket has been connected to the ide.

The most likely cause of this is a firewall blocking port 9000, or you have something else on your machine listening on port 9000. PDT should inform you if this is the case, but it may only appear in the error log.

Hope this helps.
Comment 6 Dmitry CLA 2010-09-09 08:22:39 EDT
I forgot to switch the direct internet connection to my pc. wifi router was turned on, but i switched it. and now it's passes 57% and shows that Remote Launch in the debug window http://ipicture.ru/uploads/100909/4g5WSiRSnd.png
but breakpoint(on screenshot) is ignored. Turned off firewall and antivirus. but no success. Also i tried to look up ports with netstat -a 
here what i found there related to 9000 port

TCP 0.0.0.0:9000  listening
TCP [::]:9000 listening

and thats all :(

but i suppose it should be something like:
TCP 93.72.140.147:9000 listening

Any ideas?

Thanks
Comment 7 David Kelsey CLA 2010-09-09 08:35:07 EDT
Really need the xdebug log to prove that connection was established from your server to your ide. Then that will also provide an indication as to what breakpoints are being set.
Comment 8 David Kelsey CLA 2010-09-20 11:45:02 EDT
This looks like it was a network problem. No further feedback from bug reporter so marking this as resolved.
Comment 9 Kalin CLA 2011-08-01 09:51:36 EDT
I close it taking into account Comment 8