简体   繁体   中英

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.

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.

I have mapped the server path and project path in the Run Configuration category on netbeans as specified in the documentation here .

I have also tried adding the following to my php.ini on my ec2 server

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.

The remote_host setting should be the IP address of the machine that runs the IDE . 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. If you do this from a local LAN with NAT, then you would need to setup a tunnel. There might be some hints at http://derickrethans.nl/debugging-with-xdebug-and-firewalls.html to help you with tunnels.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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