XDebug不会在atom的php-debug包的断点处中断 [英] XDebug does not break on breakpoints from atom's php-debug package

查看:88
本文介绍了XDebug不会在atom的php-debug包的断点处中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我也找到了许多其他答案,但没有一个对我有用.代码和服务器"都是本地主机. 编辑:尝试按照某些答案中的建议使用端口9001 +尝试是否使用Visual Studio Code,但奇怪的是:它在VS Code中的异常上中断,但在断点上仍未中断. 连接似乎有效:

My problem is one I found many other answers too but none worked for me. The code and "server" are both localhost. Edit: tried using port 9001 instead as suggested in some answers + tried if Visual Studio Code worked, but the strange thing is: it breaks on exceptions in VS Code but still not on breakpoints. The connection seems to work:

  • Windows 10 Pro x64
  • 运行端口81的MAMP(非专业版)
  • 原子
  • php-debug程序包
  • xdebug-2.4.1-7.0-vc14.dll扩展
  • 要调试的代码是在Laravel框架内编写的

PHP信息xdebug部分

(完整)

     xdebug

      xdebug support    enabled
    Version 2.4.1
    IDE Key XDEBUG_ECLIPSE
    XDEBUG NOT LOADED AS ZEND EXTENSION
    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.force_display_errors Off Off
    xdebug.force_error_reporting    0   0
    xdebug.halt_level   0   0
    xdebug.idekey   no value    no value
    xdebug.max_nesting_level    256 256
    xdebug.max_stack_frames -1  -1
    xdebug.overload_var_dump    2   2
    xdebug.profiler_aggregate   Off Off
    xdebug.profiler_append  Off Off
    xdebug.profiler_enable  Off Off
    xdebug.profiler_enable_trigger  Off Off
    xdebug.profiler_enable_trigger_value    no value    no value
    xdebug.profiler_output_dir  C:\Windows\Temp C:\Windows\Temp
    xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%p
    xdebug.remote_addr_header   no value    no value
    xdebug.remote_autostart On  On
    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   no value    no value
    xdebug.remote_mode  req req
    xdebug.remote_port  9000    9000
    xdebug.scream   Off Off
    xdebug.show_error_trace 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_enable_trigger_value   no value    no value
    xdebug.trace_format 0   0
    xdebug.trace_options    0   0
    xdebug.trace_output_dir C:\Windows\Temp C:\Windows\Temp
    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

php.ini xdebug部分

(完整)

[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1    # Not safe for production servers
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true
xdebug.idekey=xdebug.atom

推荐答案

我已经在这里上传了您的PHP信息输出- https://xdebug.org/wizard.php .除其他外,我还有一条消息:您似乎只将Xdebug作为普通的PHP扩展加载.这将导致奇怪的问题,请参阅

I've uploaded your PHP info output here - https://xdebug.org/wizard.php. And among others I've got next message: "You seem to have Xdebug loaded as a normal PHP extension only. This will cause odd issues, please see https://xdebug.org/docs/faq#php-ext"

问:Xdebug仅作为PHP扩展而不是Zend扩展加载.

为了使Xdebug正常工作(包括断点等),要求将它作为Zend扩展而不是作为普通的PHP扩展进行加载.某些安装工具(PEAR/PECL)有时建议您使用extension = xdebug.so加载Xdebug.这是不正确的.为了解决此问题,请在顶部块的已加载的配置文件"和已解析的其他.ini文件"下面列出的任何INI文件中,找到一行extension = xdebug.so.删除此行,然后返回量身定制的安装说明".

In order for Xdebug to work properly, including breakpoints etc. it is required that it is loaded as a Zend extension, and not just as a normal PHP extension. Some installation tools (PEAR/PECL) sometimes advice you to use extension=xdebug.so to load Xdebug. This is not correct. In order to fix this issue, please look for a line extension=xdebug.so in any of the INI files that are listed under "Loaded Configuration File" and "Additional .ini files parsed" in the top block. Remove this line, and go back to the Tailored Installation Instructions.

因此,这是针对您的情况的说明:

So here is the instructions for your case:

  1. 下载php_xdebug-2.4.1-7.0-vc14.dll
  2. 将下载的文件移至C:\MAMP\bin\php\php7.0.9\ext
  3. 编辑C:\MAMP\conf\php7.0.9\php.ini并添加zend_extension = C:\MAMP\bin\php\php7.0.9\ext\php_xdebug-2.4.1-7.0-vc14.dll
  4. 重新启动网络服务器
  1. Download php_xdebug-2.4.1-7.0-vc14.dll
  2. Move the downloaded file to C:\MAMP\bin\php\php7.0.9\ext
  3. Edit C:\MAMP\conf\php7.0.9\php.ini and add the line zend_extension = C:\MAMP\bin\php\php7.0.9\ext\php_xdebug-2.4.1-7.0-vc14.dll
  4. Restart the webserver


此外,您还可以查看带有xdebug扩展名的特殊类型的调试"功能- https ://xdebug.org/docs/all_functions


Also you may take a look at special kind of "debug" functions, which came with xdebug extension - https://xdebug.org/docs/all_functions

例如,您可以使用xdebug_break().它允许您在不使用IDE的情况下指定断点.

For example you can use xdebug_break(). It allows you to specify breakpoints without using IDE.

和有关Atom设置的说明.在此页面上 https://atom.io/packages/php-debug 配置过程.我想请您注意config.cson文件.在下面查看我的配置代码段.您的项目中有类似的东西吗?

And one note regarding Atom setup. On this page https://atom.io/packages/php-debug you may find explanation of the configuration process. I'd like to put your attention on config.cson file. Check out my config snippet below. Do you have something similar in your project?

"php-debug": 
{
    ServerPort: 9000
    PathMaps: [
        "remotepath;localpath"      
    ]
}

这篇关于XDebug不会在atom的php-debug包的断点处中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆