Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Debugger will not stop at breakpoints: Eclipse & Xdebug


Client Side Tools: ( No Apache, No PHP )


Eclipse for PHP Developers

Version: Oxygen.2 Release (4.7.2)

Build id: 20171218-0600

Redhat Enterprise Linux 6.9

java version "1.8.0_101"

Java(TM) SE Runtime Environment (build 1.8.0_101-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)


Remote Server Where The PHP web app is:


PHP 5.6.5

Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies

with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans


I've found previous posts on this topic. I didn't understand all of the things to try. I tried what I could understand, but did not have any luck. Mostly just using xdebug_break(); ( again, no luck )


I am using Eclipse and Xdebug to debug a remote PHP web site. My problem is I can not get the debugger to stop on the breakpoints I set.

I am doing remote PHP development with Eclipse and a "Synchronized PHP Project. Nothing except Eclipse is running on my computer.

I am using the Xdebug debugger on the remote server through Eclipse.

When I use the debugger it will go to the index.php. I can step through for a while and see the value of variables.

The problem is that Xdebug will not stop at any of the breakpoints I set.

I am including my Xdebug settings

Any clues as to how to find and fix the problem would be welcome

Xdebug Settings:

xdebug support,enabled
Version,2.2.7

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.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

Edit

I created an album of screen shots.

First one is an error message from Eclipse that happens when I leave it on all night.

The rest of the screen shots are pieces, in order ( top->down ) of my phpinfo output.

https://imgur.com/a/9DKev

There is no Zend section in my phpinfo() output, though there are these vars

report_zend_debug = on
zend.detect_unicode On
zend.enable_gc  On
zend.multibyte  Off 
zend.script_encoding = no value
like image 452
Steve Avatar asked Feb 12 '18 19:02

Steve


People also ask

Why won't eclipse debugger stop in breakpoints?

Eclipse 3.5.2 is not stopping in breakpoints. It's as if the debugger is using an older version of the source file. Tried the usual refresh, clean all projects, build all, with no change. Already in debug mode and the break point is checked. *ok ended up deleting the whole project and checking it out again. but still curious what the issue was.

How do I debug a PHP web page in PDT?

Click the arrow next to the debug button on the toolbar and select Open Debug Dialog -or- select Run | Open Debug Dialog. A Debug dialog will open. Double-click the PHP Web Page option to create a new debug configuration. Enter a name for the new configuration. Select the Server Debugger to be used . PDT supports both the Zend Debugger and XDebug.

How do I debug a PHP web page using Xdebug?

Your server must be running the XDebug in order for remote debugging capabilities to function. To debug a PHP Web Page: Click the arrow next to the debug button on the toolbar and select Open Debug Dialog -or- select Run | Open Debug Dialog. A Debug dialog will open.

How do you debug in Eclipse without it showing all code?

How do you debug in Eclipse without it showing all the code for classes like Scanner? You can simply not add any breakpoints in this scanner or else just in a few places of interest. Another approach that might work is to compile the scanner separately without debug info (or have that stripped off it).


1 Answers

If you follow below steps I think it should work

Latest XDebug version

Your XDebug version is from 2015 as per this https://xdebug.org/. So you should upgrade to the latest version

Setting up XDebug configuration

Setup a 99-xdebug.ini in your /usr/local/etc/php/conf.d/ or /etc/php/conf.d or /etc/php/5.6/cli/conf.d depending on which exists on your system

xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_log=/tmp/xdebug.log

Create a SSH Debug Tunnel

The machine from where you want to debug, you need to start a SSH tunnel using

ssh -R 127.0.0.1:9000:127.0.0.1:9000 -p 22 <user>@<phpserver>

Configure Remote Path mapping in Eclipse

Configure eclipse for the debugging on port 9000 and remote paths and now it should work

like image 98
Tarun Lalwani Avatar answered Oct 24 '22 05:10

Tarun Lalwani