dongxiaoguang9108 2016-10-25 15:09
浏览 67

Netbeans和PHP - 远程调试,不会遇到断点

I am attempting to debug a site (hosted on a remote server) from my local machine. I have xdebug installed on the remote machine and enabled remote debugging and auto start options for the xdebug extension.

In some ways it appears to make a connection, the site loads fine, the "debug" icon to right of the browser's search bar is highlighted, and the "styled" error messages even appear. However, it absolutely will not stop at any breakpoints.

I would greatly appreciate any guidance.

Relevant parts of php.ini (on the remote server)

; This setting is on by default.
report_zend_debug = 1
zend_extension = C:\Program Files\PHP\v5\ext\php_xdebug-2.4.1-5.6-vc11.dll

[PHP_XDEBUG-2.4.1-5.6-VC11]
xdebug.remote_enable=1
xdebug.remote_autostart = "On"
xdebug.remote_port=9000

Previously, before I put the applications on a remote server, the debugging worked fine. I have done some looking around and reading up on how it should be done, but with no success.

  • 写回答

1条回答 默认 最新

  • douyi7055 2016-10-27 08:38
    关注

    A few things I noticed that could solve your problem:

    First of all there are usually no spaces between the key and the value in .ini files. I'd recommend to remove them since this might cause problems. Furthermore, remote_autostart expects a boolean, not a string. Change it to

    xdebug.remote_autostart=1
    

    You also need to tell Xdebug where the debug client is running, so add:

    xdebug.remote_host=<ip.of.your.local.machine>
    

    Another option would be to set xdebug.remote_connect_back=1 instead, which is simpler but also less secure (since anybody who can connect to the server can run a debug session). So if possible use remote_host.

    Also make sure that the firewall (on either machine) is properly configured and doesn't block anything and that all Xdebug settings match with your settings in Netbeans.

    Hope this helps

    评论

报告相同问题?

悬赏问题

  • ¥20 Keil编译时报错"no source": Error: #5: cannot open source
  • ¥50 操作系统时间无法更新
  • ¥20 Windows11, usb转hdmi,外接显示器无反应
  • ¥20 怎么在JavaFx的TableView中动态地添加数据。
  • ¥15 MFC里的工具栏按钮图标使用外部图片
  • ¥15 如何在 llama.cpp 服务器中实现用户登录功能的优化方案?(语言-c++)
  • ¥15 有会用octave 的吗,急!代做!好偿!
  • ¥15 有一套同城小程序源码,Uniapp前端,php+html+mysql后端 ,能不能教我搭建起来可以运行,我不知道怎样操作
  • ¥15 mac调用java.io接口无法在根目录生成文件
  • ¥15 java微服务节点假死,网关路由时长延迟