简体   繁体   English

Netbeans远程调试(Xdebug)

[英]Netbeans debugging remotely (Xdebug)

I have created a remote sourced php project on an Amazon ec2 server, which I am editing the source code from netbeans from my local windows 7 machine and uploading to the ec2 instance with SFTP. 我已经在Amazon ec2服务器上创建了一个远程来源的php项目,我正在从本地Windows 7计算机上从netbeans编辑源代码,并使用SFTP上传到ec2实例。

Uploading the code is working fine and the application itself is working fine. 上传代码可以正常工作,而应用程序本身也可以正常工作。 However when I try to debug the code netbeans will NOT stop at any breakpoints. 但是,当我尝试调试代码时,netbeans不会在任何断点处停止。

I have mapped the server path and project path in the Run Configuration category on netbeans as specified in the documentation here . 我已按照此处文档中的指定,将服务器路径和项目路径映射到了netbeans的“运行配置”类别中。

I have also tried adding the following to my php.ini on my ec2 server 我也尝试将以下内容添加到我的ec2服务器上的php.ini中

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=<ip address>
xdebug.remote_port=9000
xdebug.remote_log="/tmp/log/xdebug.log"

Where the ip address = my server's IP address. ip地址=我服务器的IP地址。

The remote_host setting should be the IP address of the machine that runs the IDE . remote_host设置应该是运行IDE计算机的IP地址。 You need to make sure that the EC2 instance with Xdebug can connect to port 9000 on the network interface that talks to the EC2 instance. 您需要确保带有Xdebug的EC2实例可以连接到与EC2实例通信的网络接口上的端口9000。 If you do this from a local LAN with NAT, then you would need to setup a tunnel. 如果从具有NAT的本地LAN进行此操作,则需要设置隧道。 There might be some hints at http://derickrethans.nl/debugging-with-xdebug-and-firewalls.html to help you with tunnels. http://derickrethans.nl/debugging-with-xdebug-and-firewalls.html上可能会有一些提示,以帮助您使用隧道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM