远程调试不会在断点处停止。

时间:2023-01-18 09:40:26

I'm having a problem with xdebug not stopping at breakpoints when using remote debugging (everything is fine when running scripts via the command line). It will break at the first line of the program, then exit, not catching any breakpoints.

在使用远程调试时,xdebug不会在断点处停止(当通过命令行运行脚本时一切都很好)。它将在程序的第一行中断,然后退出,不捕获任何断点。

It used to work fine, until I switched over to using MacPorts for Apache and PHP. I've tried re-compiling it several times (with several versions), but no dice.

它以前工作得很好,直到我把它转换为Apache和PHP的MacPorts。我尝试过多次重新编译它(有几个版本),但是没有骰子。

I'm using PHP 5.3.1 and Xdebug 2.1.0-beta3

我使用的是PHP 5.3.1和Xdebug 2.1.0-beta3。

I've also tried at least 3 different debugging programs (MacGDBp, Netbeans and JetBrains Web IDE).

我还尝试了至少3种不同的调试程序(MacGDBp、Netbeans和JetBrains Web IDE)。

My php.ini settings look like:

我的php。ini设置看起来像:

[xdebug]
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=localhost
xdebug.idekey=webide

And when I log the debugger output, setting a breakpoint looks like this/;

当我记录调试器输出时,设置断点是这样的/;

<- breakpoint_set -i 895 -t line -f file:///Users/WM_imac/Sites/wm/debug_test.php -n 13 -s enabled -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="895" state="enabled" id="890660002"></response>

<- breakpoint_set -i - 895 -t line -f文件:///用户/WM_imac/ site /wm/debug_test。php - n13 -s启用->

When run, the debugger will get the context of the first line of the application, then send the detach and stop messages.

当运行时,调试器将获得应用程序的第一行的上下文,然后发送detach和stop消息。

However, this line is output when starting the debugger.

然而,这一行在启动调试器时输出。

<- feature_get -i 885 -n breakpoint_types -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="885" feature_name="breakpoint_types" supported="1"><![CDATA[line conditional call return exception]]></response>

< / span >< span lang = en - us style = ' font - size: 9.0 pt; font - family:宋体;mso - ascii - font - family: tahoma;[CDATA[行条件调用返回异常]]>。

Does 'line conditional call return exception' mean anything?

行条件调用返回异常是否意味着什么?

19 个解决方案

#1


32  

I had this problem and took me ages to find the answer.

我遇到了这个问题,花了很长时间才找到答案。

In your debug config, in the server area, click Configure, go to Path Mapping, click the path that's there and click edit, change to Path in file system and navigate to the correct file.

在调试配置中,在服务器区域,单击Configure,转到路径映射,单击那里的路径并单击edit,更改为文件系统中的路径,并导航到正确的文件。

Done.

完成了。

#2


17  

I had the same problem, and finally I found that my php.ini was missing these two important settings:

我遇到了同样的问题,最后我发现了我的php。ini忽略了这两个重要的设置:

xdebug.remote_autostart = "On"
xdebug.remote_enable = "On"

Then it worked perfectly.

那么完美的工作。

#3


8  

XDebug works fine in my Ubuntu Lucid box using NetBeans, and i do have the zend_extension line in my php.ini (/etc/php5/apache2/php.ini).

XDebug在我的Ubuntu透明框中使用NetBeans很好,而我在php中确实有zend_extension。ini(/ etc / php5 /输入/ php . ini)。

I'm using netbeans 6.9 and PHP 5.2 with xdebug 2.0.4-2

我使用的是netbeans 6.9和PHP 5.2, xdebug 2.0.4-2。

I'm pasting the relevant lines here, hope it helps:

我在这里粘贴相关的线,希望它能有所帮助:

zend_extension=/usr/lib/php5/20060613/xdebug.so

[debug]
; Remote settings
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"

; General
xdebug.auto_trace=off
xdebug.collect_includes=on
xdebug.collect_params=off
xdebug.collect_return=off
xdebug.default_enable=on
xdebug.extended_info=1
xdebug.manual_url=http://www.php.net
xdebug.show_local_vars=1
xdebug.show_mem_delta=0
xdebug.max_nesting_level=100
;xdebug.idekey=

; Trace options
xdebug.trace_format=0
xdebug.trace_output_dir=/tmp
xdebug.trace_options=0
xdebug.trace_output_name=crc32

; Profiling
xdebug.profiler_append=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=crc32

#4


7  

from http://xdebug.org/docs/install , "You should ignore any prompts to add "extension=xdebug.so" to php.ini — this will cause problems."

从http://xdebug.org/docs/install,“您应该忽略任何提示添加”扩展=xdebug。所以“php。这将导致问题。

so, this fixed it for me :

所以,这帮我解决了这个问题:

in the config file , where you load the xdebug extension ( for me , for the CLI version of php , that was /etc/php5/cli/conf.d/xdebug.ini ) - dont specify

在配置文件中,加载xdebug扩展(对于我来说,对于php的CLI版本,这是/etc/php5/cli/conf.d/xdebug.)。-不要指定。

extension=xdebug.so

扩展= xdebug.so

instead , use

相反,使用

zend_extension=/path/to/xdebug/module/xdebug.so

zend_extension = / / / xdebug /模块/ xdebug.so路径

( for me , this was something like /usr/lib/php5/(...)/xdebug.so )

(对我来说,这有点像/usr/lib/php5/(…)/xdebug。)

#5


5  

I have had the same issue, the solution for me was to have the local code on the same path as the remote code.

我有同样的问题,我的解决方案是让本地代码与远程代码在同一路径上。

Example

On the webserver the code was located on the path: /var/www/dev01/app_name

在webserver上,代码位于路径上:/var/www/dev01/app_name。

Locally the code was located in my home directory: /home/me/projects/app_name

本地代码位于我的主目录:/home/me/projects/app_name。

This configuration caused my IDE (Eclipse and Komodo) to fly straight past the breakpoints.

这个配置导致我的IDE (Eclipse和Komodo)直接飞过断点。

Changing the local path from /home/me/projects/app_name to /var/www/dev01/app_name fixed the issue. Using sshfs to locally mount the remote filesystem makes it even easier.

从/home/me/projects/app_name到/var/www/dev01/app_name更改本地路径以解决这个问题。使用sshfs在本地挂载远程文件系统使其更加容易。

#6


4  

I just experienced something similar to safl's comment above using Komodo but not sure if it's related:

我刚刚经历了一些类似safl的评论,使用Komodo,但不确定是否相关:

I had xdebug set up using zend_extension with Komodo and it works perfectly, can set breakpoints and xdebug_break(), but only some files. Others did not work.

我使用zend_extension和Komodo建立了xdebug,它可以完美地工作,可以设置断点和xdebug_break(),但只有一些文件。其他的没有工作。

The solution was in the way that the mapping of the remote and local paths occurred. Turns out that Komodo is doing a case-sensitive compare on path name, so my mapping didn't quite match. Files that the debugger opened from stepping through were on the right path, but files that I opened through the ide had an uppercase driveletter which apparently caused Komodo to overlook.

解决方案是远程和本地路径映射的方式。事实证明,Komodo正在对路径名进行区分大小写的比较,所以我的映射不太匹配。调试器打开的文件在正确的路径上,但是我通过ide打开的文件有一个上面的driveletter,这显然导致了Komodo的忽略。

#7


3  

I tried all these solutions to no avail. I was confused because XDebug worked for one of my projects but not this new one. After stumbling around comparing configuration properties, I realized that on

我试了所有这些方法都无济于事。我很困惑,因为XDebug为我的一个项目工作,而不是这个新项目。在比较了配置属性之后,我意识到了这一点。

Project Properties > Sources > Web root:

项目性质>源>网根:

the value was set to a default value on the new project, but set to webroot on the existing project. So, I browsed to the project's webroot and set that value. I tested it and, bada-bing, it worked.

该值被设置为新项目的默认值,但在现有项目上设置为webroot。所以,我浏览了项目的webroot并设置了这个值。我测试了它,bada-bing,它成功了。

远程调试不会在断点处停止。

#8


2  

Are you totally sure you're not loading the Xdebug via extension=xdebug.so? Xdebug will load if this line appears in your php.ini (i.e. it appears in phpinfo() output, etc.) but breakpoints do not work if loaded in this way. (It will even connect to debugger clients, and accept breakpoints--they just never get triggered.)

您是否完全确定您没有通过扩展= Xdebug来加载Xdebug ?如果这一行出现在您的php中,将加载Xdebug。ini(即它出现在phpinfo()输出中),但是如果以这种方式加载,断点不会起作用。(它甚至会连接到调试器客户机,并接受断点——它们永远不会被触发。)

I suggest you comment out the zend_extension line and see if it's still loaded--you might think you're loading Xdebug via /etc/php5/conf.d/xdebug.ini, for example, but something has added it to /etc/php5/apache2/php.ini behind your back.

我建议您对zend_extension行进行注释,看看它是否仍然被加载——您可能会认为您正在通过/etc/php5/conf.d/xdebug加载Xdebug。例如,但有些东西将它添加到/etc/php5/apache2/php。ini背后。

See this question & answer for more information.

请参阅这个问题并回答更多的信息。

#9


2  

I ran into this same exact thing and was banging my head against it for a while. At some point I had also added ZendDebugger.so to my PHP.ini and that was what was breaking Xdebug. Commenting out the ZendDebugger.so line in my php.ini fixed it.

我遇到了同样的事情,并在一段时间内用头撞它。在某个时候,我还添加了ZendDebugger。所以我的PHP。这就是破解Xdebug的原因。评论ZendDebugger。在我的php中。ini固定它。

If you're not using ZendDebugger, you might just start disabling other Zend extensions and see if it's another extension causing the conflict.

如果您没有使用ZendDebugger,您可能会开始禁用其他Zend扩展,并查看它是否是导致冲突的另一个扩展。

#10


2  

I use Eclipse and also looked for a while. All things in php.ini have been right.

我使用Eclipse,也会寻找一段时间。在php中。ini一直是正确的。

At the end, I found out, that in Eclipse the debugger was set so ZEND-Debugger. After I changed it to XDEBUG it worked fine.

最后,我发现,在Eclipse中,调试器被设置为ZEND-Debugger。在我将它更改为XDEBUG之后,它运行良好。

Regards Joerg

问候Joerg

#11


0  

Could you provide complete session log while trying to debug with Web IDE?

在尝试使用Web IDE调试时,是否可以提供完整的会话日志?

BTW when using Web IDE you typically don't need to set xdebug.idekey=webide since ide key is automatically assigned via url parameter.

在使用Web IDE时,通常不需要设置xdebug。ide密钥是通过url参数自动分配的。

#12


0  

I hit into that from time to time and have never been able to find out the real cause of the issue.

我不时地碰到这种情况,从来没能找到问题的真正原因。

I usually resolve by,

我通常解决的,

  1. Placing more breakpoints at the client code constructing the instances and loading the classes (as it seems like XDebug will ignore some breakpoints due to class-loading issues). You can learn and realize where these locations are by doing some step-ins.

    在客户端代码中放置更多的断点来构建实例并加载类(因为看起来XDebug会因为类加载问题而忽略一些断点)。你可以学习并认识到这些位置是通过做一些步骤来实现的。

  2. Check the source paths of the dependencies. XDebug picks up these files by their full paths, you can see how your IDE addresses them at your breakpoint panel.

    检查依赖项的源路径。XDebug通过它们的完整路径获取这些文件,您可以看到您的IDE是如何在您的断点面板上处理它们的。

#13


0  

In my case, the problem was happening in only one project (I was only able to break using xdebug_break), while in the other projects was working fine.

在我的例子中,这个问题只发生在一个项目中(我只能使用xdebug_break来中断),而在其他项目中则运行良好。

It was fixed editing the file: nbproject/private/private.properties: And set:

它是固定编辑文件:nbproject/private/private。属性:并设置:

copy.src.files=false

When I created the project I selected "copy sources" option by mistake. Then I manually moved the project and edited its source path (at the "nbproject/project.properties" file), which the debugger was still looking for the old path (set in copy.src.target).

当我创建项目时,我错误地选择了“copy sources”选项。然后我手动移动项目并编辑它的源路径(在“nbproject/project”中)。属性“文件”,调试器仍然在寻找旧路径(在copy.src.target中设置)。

So technically, other way to fix this DEBUG problem is to recreate the nbproject directory (by removing it and creating the project again). I guess the debugger should work fine with the "copy" option enabled (as I never use it).

因此,从技术上来说,修复这个调试问题的另一种方法是重新创建nbproject目录(通过删除它并再次创建项目)。我想调试器应该可以使用“复制”选项(因为我从来不用它)。

I hope this can help.

我希望这能有所帮助。

#14


0  

I had a similar issue and came across a post to fix the problem. My html form (testform.html) was calling a php script (runQuery.php) and Netbeans could not break at the set break points in my runQuery.php

我有一个类似的问题,遇到了一个解决问题的帖子。我的html表单(testform.html)调用了一个php脚本(runQuery.php)和Netbeans不能在我的runQuery.php的设置断点处断开。

After checking all the configuration settings in php.ini and Netbeans by searching on forums like this one, I discovered that netbeans will only break on the break points if the Index file for the project is a PHP file. This is very important otherwise you will spend hours trying to figure out why break points are not working.

检查完php中的所有配置设置之后。通过在像这样的论坛上搜索ini和Netbeans,我发现如果项目的索引文件是一个PHP文件,Netbeans只会破坏断点。这是非常重要的,否则你将花费数小时试图找出为什么断点不工作。

In Netbeans go into the File/Project Properties/Run Configuration and check that the Index file is a PHP file. In my case I changed my index file from testform.html to testform.php and it worked, I was able to break on break points.

在Netbeans中,进入文件/项目属性/运行配置,并检查索引文件是否是一个PHP文件。在我的例子中,我从testform更改了索引文件。testform html。php和它的工作,我能够打破断点。

#15


0  

When it comes to paths, OSX file system is not case sensitive, but xdebug seems to be.

在路径方面,OSX文件系统不是区分大小写的,但是xdebug似乎是。

In my case everything seemed to work even though I was running the script using /proj/test.php instead of /Proj/test.php.

在我的情况下,即使我使用/proj/test运行脚本,一切似乎都能正常工作。php /项目/ test.php。

When xdebug (or at lest the version I currently have) is checking for breakpoints, the check is case-sensitive. If the break point is set for /Proj/test.php, but the script is run via /proj/test.php then there is no match.

当xdebug(或至少是我当前的版本)正在检查断点时,检查是大小写敏感的。如果断点设置为/Proj/test。php,但是脚本是通过/proj/test运行的。php没有匹配。

I also had a similar problem with the PHP include path. The path included /proj -directory, which was wrong. Running the code worked, but since the breakpoints were set using /Proj, they were not hit.

我在PHP中也有类似的问题,包括path。路径包括/proj -目录,这是错误的。运行代码是有效的,但是由于断点是使用/Proj设置的,所以它们没有被命中。

To check if this is the problem:

检查这是否是问题所在:

  • Enable logging, -dxdebug.remote_log=/tmp/remote.log
  • 启用日志记录,-dxdebug.remote_log = / tmp / remote.log
  • Check the exact path in the log when breakpoints are set
  • 在设置断点时,检查日志中的正确路径。
  • Compare the path to the PHP intepreter is using, for example: echo dirname(__FILE__) ;
  • 比较PHP intepreter使用的路径,例如:echo dirname(__FILE__);

#16


0  

There can also be a problem with unusual symbols in the path. For example,I was having my code located by path:

在道路上也可能出现一些不寻常的符号。例如,我的代码位于path:

C:\[dev]\OpenServer\domains\...

And I was unable to catch anything, but after changing path problem disappeared:

我无法捕捉到任何东西,但在改变路径问题后消失了:

C:\dev\OpenServer\domains\...

So even brackets matter.

所以即使括号。

#17


0  

I was trying to debug with PhpStorm, but it didn't stop at some breakpoints and started ignoring even more as I was trying every single solution I could find with Google.

我试着调试PhpStorm,但它并没有停在一些断点上,并且开始忽略更多,因为我正在尝试用谷歌找到的每一个解决方案。

The problem was there were multiple detached PHP processes running in the background that actually handled my requests. PhpStorm didn't stop at breakpoints because the process I was debugging wasn't receiving requests. Killing these processes solved it for me.

问题是,在实际处理我的请求的后台运行了多个独立的PHP进程。PhpStorm没有在断点处停止,因为我正在调试的进程没有收到请求。杀死这些过程为我解决了这个问题。

#18


0  

I can't comment on a post therefore this post.

因此,我无法对这篇文章发表评论。

The solution to my problem was a lot like pitchandtone said. Eclipce had made wrong and double path mapping items. Nevertheless I could use the relative paths (i.e. /project/folder).

我的问题的解决方法很像pitchandtone说的。Eclipce做了错误的双路径映射项目。不过,我可以使用相对路径(即/项目/文件夹)。

#19


0  

I hate these configurations. My life was changed when I knew the lib Dephpugger.

我讨厌这些配置。当我认识了lib Dephpugger后,我的生活发生了变化。

Is a debugger to run in terminal (like ipdb for Python and byebug for Ruby). https://github.com/tacnoman/dephpugger Is very easy to use.

是在终端运行的调试器(如Python的ipdb和Ruby的byebug)。https://github.com/tacnoman/dephpugger非常容易使用。

#1


32  

I had this problem and took me ages to find the answer.

我遇到了这个问题,花了很长时间才找到答案。

In your debug config, in the server area, click Configure, go to Path Mapping, click the path that's there and click edit, change to Path in file system and navigate to the correct file.

在调试配置中,在服务器区域,单击Configure,转到路径映射,单击那里的路径并单击edit,更改为文件系统中的路径,并导航到正确的文件。

Done.

完成了。

#2


17  

I had the same problem, and finally I found that my php.ini was missing these two important settings:

我遇到了同样的问题,最后我发现了我的php。ini忽略了这两个重要的设置:

xdebug.remote_autostart = "On"
xdebug.remote_enable = "On"

Then it worked perfectly.

那么完美的工作。

#3


8  

XDebug works fine in my Ubuntu Lucid box using NetBeans, and i do have the zend_extension line in my php.ini (/etc/php5/apache2/php.ini).

XDebug在我的Ubuntu透明框中使用NetBeans很好,而我在php中确实有zend_extension。ini(/ etc / php5 /输入/ php . ini)。

I'm using netbeans 6.9 and PHP 5.2 with xdebug 2.0.4-2

我使用的是netbeans 6.9和PHP 5.2, xdebug 2.0.4-2。

I'm pasting the relevant lines here, hope it helps:

我在这里粘贴相关的线,希望它能有所帮助:

zend_extension=/usr/lib/php5/20060613/xdebug.so

[debug]
; Remote settings
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"

; General
xdebug.auto_trace=off
xdebug.collect_includes=on
xdebug.collect_params=off
xdebug.collect_return=off
xdebug.default_enable=on
xdebug.extended_info=1
xdebug.manual_url=http://www.php.net
xdebug.show_local_vars=1
xdebug.show_mem_delta=0
xdebug.max_nesting_level=100
;xdebug.idekey=

; Trace options
xdebug.trace_format=0
xdebug.trace_output_dir=/tmp
xdebug.trace_options=0
xdebug.trace_output_name=crc32

; Profiling
xdebug.profiler_append=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=crc32

#4


7  

from http://xdebug.org/docs/install , "You should ignore any prompts to add "extension=xdebug.so" to php.ini — this will cause problems."

从http://xdebug.org/docs/install,“您应该忽略任何提示添加”扩展=xdebug。所以“php。这将导致问题。

so, this fixed it for me :

所以,这帮我解决了这个问题:

in the config file , where you load the xdebug extension ( for me , for the CLI version of php , that was /etc/php5/cli/conf.d/xdebug.ini ) - dont specify

在配置文件中,加载xdebug扩展(对于我来说,对于php的CLI版本,这是/etc/php5/cli/conf.d/xdebug.)。-不要指定。

extension=xdebug.so

扩展= xdebug.so

instead , use

相反,使用

zend_extension=/path/to/xdebug/module/xdebug.so

zend_extension = / / / xdebug /模块/ xdebug.so路径

( for me , this was something like /usr/lib/php5/(...)/xdebug.so )

(对我来说,这有点像/usr/lib/php5/(…)/xdebug。)

#5


5  

I have had the same issue, the solution for me was to have the local code on the same path as the remote code.

我有同样的问题,我的解决方案是让本地代码与远程代码在同一路径上。

Example

On the webserver the code was located on the path: /var/www/dev01/app_name

在webserver上,代码位于路径上:/var/www/dev01/app_name。

Locally the code was located in my home directory: /home/me/projects/app_name

本地代码位于我的主目录:/home/me/projects/app_name。

This configuration caused my IDE (Eclipse and Komodo) to fly straight past the breakpoints.

这个配置导致我的IDE (Eclipse和Komodo)直接飞过断点。

Changing the local path from /home/me/projects/app_name to /var/www/dev01/app_name fixed the issue. Using sshfs to locally mount the remote filesystem makes it even easier.

从/home/me/projects/app_name到/var/www/dev01/app_name更改本地路径以解决这个问题。使用sshfs在本地挂载远程文件系统使其更加容易。

#6


4  

I just experienced something similar to safl's comment above using Komodo but not sure if it's related:

我刚刚经历了一些类似safl的评论,使用Komodo,但不确定是否相关:

I had xdebug set up using zend_extension with Komodo and it works perfectly, can set breakpoints and xdebug_break(), but only some files. Others did not work.

我使用zend_extension和Komodo建立了xdebug,它可以完美地工作,可以设置断点和xdebug_break(),但只有一些文件。其他的没有工作。

The solution was in the way that the mapping of the remote and local paths occurred. Turns out that Komodo is doing a case-sensitive compare on path name, so my mapping didn't quite match. Files that the debugger opened from stepping through were on the right path, but files that I opened through the ide had an uppercase driveletter which apparently caused Komodo to overlook.

解决方案是远程和本地路径映射的方式。事实证明,Komodo正在对路径名进行区分大小写的比较,所以我的映射不太匹配。调试器打开的文件在正确的路径上,但是我通过ide打开的文件有一个上面的driveletter,这显然导致了Komodo的忽略。

#7


3  

I tried all these solutions to no avail. I was confused because XDebug worked for one of my projects but not this new one. After stumbling around comparing configuration properties, I realized that on

我试了所有这些方法都无济于事。我很困惑,因为XDebug为我的一个项目工作,而不是这个新项目。在比较了配置属性之后,我意识到了这一点。

Project Properties > Sources > Web root:

项目性质>源>网根:

the value was set to a default value on the new project, but set to webroot on the existing project. So, I browsed to the project's webroot and set that value. I tested it and, bada-bing, it worked.

该值被设置为新项目的默认值,但在现有项目上设置为webroot。所以,我浏览了项目的webroot并设置了这个值。我测试了它,bada-bing,它成功了。

远程调试不会在断点处停止。

#8


2  

Are you totally sure you're not loading the Xdebug via extension=xdebug.so? Xdebug will load if this line appears in your php.ini (i.e. it appears in phpinfo() output, etc.) but breakpoints do not work if loaded in this way. (It will even connect to debugger clients, and accept breakpoints--they just never get triggered.)

您是否完全确定您没有通过扩展= Xdebug来加载Xdebug ?如果这一行出现在您的php中,将加载Xdebug。ini(即它出现在phpinfo()输出中),但是如果以这种方式加载,断点不会起作用。(它甚至会连接到调试器客户机,并接受断点——它们永远不会被触发。)

I suggest you comment out the zend_extension line and see if it's still loaded--you might think you're loading Xdebug via /etc/php5/conf.d/xdebug.ini, for example, but something has added it to /etc/php5/apache2/php.ini behind your back.

我建议您对zend_extension行进行注释,看看它是否仍然被加载——您可能会认为您正在通过/etc/php5/conf.d/xdebug加载Xdebug。例如,但有些东西将它添加到/etc/php5/apache2/php。ini背后。

See this question & answer for more information.

请参阅这个问题并回答更多的信息。

#9


2  

I ran into this same exact thing and was banging my head against it for a while. At some point I had also added ZendDebugger.so to my PHP.ini and that was what was breaking Xdebug. Commenting out the ZendDebugger.so line in my php.ini fixed it.

我遇到了同样的事情,并在一段时间内用头撞它。在某个时候,我还添加了ZendDebugger。所以我的PHP。这就是破解Xdebug的原因。评论ZendDebugger。在我的php中。ini固定它。

If you're not using ZendDebugger, you might just start disabling other Zend extensions and see if it's another extension causing the conflict.

如果您没有使用ZendDebugger,您可能会开始禁用其他Zend扩展,并查看它是否是导致冲突的另一个扩展。

#10


2  

I use Eclipse and also looked for a while. All things in php.ini have been right.

我使用Eclipse,也会寻找一段时间。在php中。ini一直是正确的。

At the end, I found out, that in Eclipse the debugger was set so ZEND-Debugger. After I changed it to XDEBUG it worked fine.

最后,我发现,在Eclipse中,调试器被设置为ZEND-Debugger。在我将它更改为XDEBUG之后,它运行良好。

Regards Joerg

问候Joerg

#11


0  

Could you provide complete session log while trying to debug with Web IDE?

在尝试使用Web IDE调试时,是否可以提供完整的会话日志?

BTW when using Web IDE you typically don't need to set xdebug.idekey=webide since ide key is automatically assigned via url parameter.

在使用Web IDE时,通常不需要设置xdebug。ide密钥是通过url参数自动分配的。

#12


0  

I hit into that from time to time and have never been able to find out the real cause of the issue.

我不时地碰到这种情况,从来没能找到问题的真正原因。

I usually resolve by,

我通常解决的,

  1. Placing more breakpoints at the client code constructing the instances and loading the classes (as it seems like XDebug will ignore some breakpoints due to class-loading issues). You can learn and realize where these locations are by doing some step-ins.

    在客户端代码中放置更多的断点来构建实例并加载类(因为看起来XDebug会因为类加载问题而忽略一些断点)。你可以学习并认识到这些位置是通过做一些步骤来实现的。

  2. Check the source paths of the dependencies. XDebug picks up these files by their full paths, you can see how your IDE addresses them at your breakpoint panel.

    检查依赖项的源路径。XDebug通过它们的完整路径获取这些文件,您可以看到您的IDE是如何在您的断点面板上处理它们的。

#13


0  

In my case, the problem was happening in only one project (I was only able to break using xdebug_break), while in the other projects was working fine.

在我的例子中,这个问题只发生在一个项目中(我只能使用xdebug_break来中断),而在其他项目中则运行良好。

It was fixed editing the file: nbproject/private/private.properties: And set:

它是固定编辑文件:nbproject/private/private。属性:并设置:

copy.src.files=false

When I created the project I selected "copy sources" option by mistake. Then I manually moved the project and edited its source path (at the "nbproject/project.properties" file), which the debugger was still looking for the old path (set in copy.src.target).

当我创建项目时,我错误地选择了“copy sources”选项。然后我手动移动项目并编辑它的源路径(在“nbproject/project”中)。属性“文件”,调试器仍然在寻找旧路径(在copy.src.target中设置)。

So technically, other way to fix this DEBUG problem is to recreate the nbproject directory (by removing it and creating the project again). I guess the debugger should work fine with the "copy" option enabled (as I never use it).

因此,从技术上来说,修复这个调试问题的另一种方法是重新创建nbproject目录(通过删除它并再次创建项目)。我想调试器应该可以使用“复制”选项(因为我从来不用它)。

I hope this can help.

我希望这能有所帮助。

#14


0  

I had a similar issue and came across a post to fix the problem. My html form (testform.html) was calling a php script (runQuery.php) and Netbeans could not break at the set break points in my runQuery.php

我有一个类似的问题,遇到了一个解决问题的帖子。我的html表单(testform.html)调用了一个php脚本(runQuery.php)和Netbeans不能在我的runQuery.php的设置断点处断开。

After checking all the configuration settings in php.ini and Netbeans by searching on forums like this one, I discovered that netbeans will only break on the break points if the Index file for the project is a PHP file. This is very important otherwise you will spend hours trying to figure out why break points are not working.

检查完php中的所有配置设置之后。通过在像这样的论坛上搜索ini和Netbeans,我发现如果项目的索引文件是一个PHP文件,Netbeans只会破坏断点。这是非常重要的,否则你将花费数小时试图找出为什么断点不工作。

In Netbeans go into the File/Project Properties/Run Configuration and check that the Index file is a PHP file. In my case I changed my index file from testform.html to testform.php and it worked, I was able to break on break points.

在Netbeans中,进入文件/项目属性/运行配置,并检查索引文件是否是一个PHP文件。在我的例子中,我从testform更改了索引文件。testform html。php和它的工作,我能够打破断点。

#15


0  

When it comes to paths, OSX file system is not case sensitive, but xdebug seems to be.

在路径方面,OSX文件系统不是区分大小写的,但是xdebug似乎是。

In my case everything seemed to work even though I was running the script using /proj/test.php instead of /Proj/test.php.

在我的情况下,即使我使用/proj/test运行脚本,一切似乎都能正常工作。php /项目/ test.php。

When xdebug (or at lest the version I currently have) is checking for breakpoints, the check is case-sensitive. If the break point is set for /Proj/test.php, but the script is run via /proj/test.php then there is no match.

当xdebug(或至少是我当前的版本)正在检查断点时,检查是大小写敏感的。如果断点设置为/Proj/test。php,但是脚本是通过/proj/test运行的。php没有匹配。

I also had a similar problem with the PHP include path. The path included /proj -directory, which was wrong. Running the code worked, but since the breakpoints were set using /Proj, they were not hit.

我在PHP中也有类似的问题,包括path。路径包括/proj -目录,这是错误的。运行代码是有效的,但是由于断点是使用/Proj设置的,所以它们没有被命中。

To check if this is the problem:

检查这是否是问题所在:

  • Enable logging, -dxdebug.remote_log=/tmp/remote.log
  • 启用日志记录,-dxdebug.remote_log = / tmp / remote.log
  • Check the exact path in the log when breakpoints are set
  • 在设置断点时,检查日志中的正确路径。
  • Compare the path to the PHP intepreter is using, for example: echo dirname(__FILE__) ;
  • 比较PHP intepreter使用的路径,例如:echo dirname(__FILE__);

#16


0  

There can also be a problem with unusual symbols in the path. For example,I was having my code located by path:

在道路上也可能出现一些不寻常的符号。例如,我的代码位于path:

C:\[dev]\OpenServer\domains\...

And I was unable to catch anything, but after changing path problem disappeared:

我无法捕捉到任何东西,但在改变路径问题后消失了:

C:\dev\OpenServer\domains\...

So even brackets matter.

所以即使括号。

#17


0  

I was trying to debug with PhpStorm, but it didn't stop at some breakpoints and started ignoring even more as I was trying every single solution I could find with Google.

我试着调试PhpStorm,但它并没有停在一些断点上,并且开始忽略更多,因为我正在尝试用谷歌找到的每一个解决方案。

The problem was there were multiple detached PHP processes running in the background that actually handled my requests. PhpStorm didn't stop at breakpoints because the process I was debugging wasn't receiving requests. Killing these processes solved it for me.

问题是,在实际处理我的请求的后台运行了多个独立的PHP进程。PhpStorm没有在断点处停止,因为我正在调试的进程没有收到请求。杀死这些过程为我解决了这个问题。

#18


0  

I can't comment on a post therefore this post.

因此,我无法对这篇文章发表评论。

The solution to my problem was a lot like pitchandtone said. Eclipce had made wrong and double path mapping items. Nevertheless I could use the relative paths (i.e. /project/folder).

我的问题的解决方法很像pitchandtone说的。Eclipce做了错误的双路径映射项目。不过,我可以使用相对路径(即/项目/文件夹)。

#19


0  

I hate these configurations. My life was changed when I knew the lib Dephpugger.

我讨厌这些配置。当我认识了lib Dephpugger后,我的生活发生了变化。

Is a debugger to run in terminal (like ipdb for Python and byebug for Ruby). https://github.com/tacnoman/dephpugger Is very easy to use.

是在终端运行的调试器(如Python的ipdb和Ruby的byebug)。https://github.com/tacnoman/dephpugger非常容易使用。