Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Xdebug Test Button Grayed Out In Debug Configuration. Why?
Xdebug Test Button Grayed Out In Debug Configuration. Why? [message #1781232] Sat, 03 February 2018 18:03 Go to next message
Steve _____ is currently offline Steve _____Friend
Messages: 39
Registered: April 2012
Member


I am trying to debug a PHP site on a remote server with a copy of Xdebug installed on that remote server.

I do not have Apache or PHP on the computer where my Eclipse (Oxygen, latest release ) is installed.

I created a "Synchronized PHP Project" of a copy of the PHP files to edit them "remotely".

I created a "server" via Windows > Preferences that points to the base URL of the remote server & site I am trying to debug.

I then started reading the PHP Development Tutorial in Eclipse Help Contents as to how to set up a Debug Configuration. I filled out all of the fields except for "document root", not being sure what that refers to.

In the tabbed dialog for the Debug Configuration "Xdebug" is listed as the debugger with a "Configuration" and "Test" button next to.

The "Test" button is greyed out and I can't figure out why, having filled everything I could in.

I tried filling in the fields for SSH Tunneling ( not sure what this for or what it does ). When activating it I got a couple of blank grey boxes coming up, the "Test" button still greyed out.

Any clues as to what I need to do to get the "Test" button working for Xdebug?
Re: Xdebug Test Button Grayed Out In Debug Configuration. Why? [message #1781234 is a reply to message #1781232] Sat, 03 February 2018 23:37 Go to previous messageGo to next message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 216
Registered: March 2013
Senior Member
Because there is no simple way to check it:
1. PHP CLI != PHP WEB (doesn't matter fpm or apache module)
2. xDebug by default allow only localhost debuging, to invoke it you need cookie and working path to known PHP file

We correctly detect CLI xDebug, but for it's not possible to do same with web xDebug by design.

In opposite Zend Debugger by design require dummy.php file that can be easy checked by IDE.

PHP remote projects allows you to sync-on-save or sync-on-demand file. It have noting to debugger.

You can debug remote server using your local file only, there is two way:
1. Enable xdebug remote debugging, for example by connect_back: https://xdebug.org/docs/all_settings#remote_connect_back
2. Configure debug launch configuration (debug-> debug configuration -> php web server) select / create your config, go to debugger path and configure your ssh tunnel. It's not possible to use port other than 22 and host other that your website address.


Re: Xdebug Test Button Grayed Out In Debug Configuration. Why? [message #1781244 is a reply to message #1781234] Sun, 04 February 2018 21:00 Go to previous messageGo to next message
Steve _____ is currently offline Steve _____Friend
Messages: 39
Registered: April 2012
Member
Dawid Pakula wrote on Sat, 03 February 2018 18:37

You can debug remote server using your local file only, there is two way:
1. Enable xdebug remote debugging, for example by connect_back: https://xdebug.org/docs/all_settings#remote_connect_back
2. Configure debug launch configuration (debug-> debug configuration -> php web server) select / create your config, go to debugger path and configure your ssh tunnel. It's not possible to use port other than 22 and host other that your website address.


Thank you for this very interesting and useful post.

Do I need an SSH tunnel to do remote debugging?

Should I set xdebug.remote_connect_back to 1?

If I have the other xdebug variables set to the the settings shown in the tutorials will that be enough with xdebug.remote_connect_back = 1 ?

Thanks again for the interesting answer.
Re: Xdebug Test Button Grayed Out In Debug Configuration. Why? [message #1781245 is a reply to message #1781244] Sun, 04 February 2018 21:23 Go to previous messageGo to next message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 216
Registered: March 2013
Senior Member
With xDebug, server connects to debugger client. xdebug.remote_connect_back depends on _SERVER['REMOTE_ADDRESS'], if you run xdebugger (via cookie on URL), it trying to connect on port 9000 to your public ip address visible from server point. So if you are behind firewall/nat and cannot open/forward this port, you need SSH tunnel. In this way correct way is default xdebug configuration, xdebug.remote_host set to localhost, and tunnel from server 9000 as your localhost:9000. See for example docs on phpstorm, they are universal, PDT by default is ready for connection on localhost:9000 after startup: https://confluence.jetbrains.com/display/PhpStorm/Remote+debugging+in+PhpStorm+via+SSH+tunnel

Re: Xdebug Test Button Grayed Out In Debug Configuration. Why? [message #1781287 is a reply to message #1781232] Mon, 05 February 2018 15:05 Go to previous message
Steve _____ is currently offline Steve _____Friend
Messages: 39
Registered: April 2012
Member
I don't think I am behind a firewall. I will double check. This is how I have the Xdebug set on the remote server.

My eclipse is on my computer. I am developing and debugging a PHP site on a remote server with Xdebug installed on a remote server:
xdebug support,enabled
Version,2.2.7

IDE Key,slickedit
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,slickedit,slickedit

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,On,On
xdebug.profiler_output_dir,/tmp,/tmp
xdebug.profiler_output_name,cachegrind.out.%t.%s,cachegrind.out.%t.%s

xdebug.remote_autostart,Off,Off

xdebug.remote_connect_back,On,On
xdebug.remote_cookie_expire_time,3600,3600
xdebug.remote_enable,On,On
xdebug.remote_handler,dbgp,dbgp
xdebug.remote_host,127.0.0.1,127.0.0.1
xdebug.remote_log,/var/log/xdebug/xdebug.log,/var/log/xdebug/xdebug.log
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,/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



Is there anything you think I should change?

Thanks much again for your help

Previous Topic:Help setting up remote debugging with Eclipse and Xdebug
Next Topic:Remote Synchronization keeps appearing & disappearing: No files changed
Goto Forum:
  


Current Time: Tue Feb 20 11:07:14 GMT 2018

Powered by FUDForum. Page generated in 0.02078 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software