使用Xdebug和Netbeans在本地主机上远程调试PHP网站的正确方法

使用Xdebug和Netbeans在本地主机上远程调试PHP网站的正确方法,php,debugging,netbeans,xdebug,Php,Debugging,Netbeans,Xdebug,我在使用xdebug和netbeans配置进行远程调试时遇到问题 我可以在本地主机上使用xdebug和netbeans进行调试,效果非常好。。但是在远程服务器上,当我设置断点并调试文件时,它不会在任何断点上停止。我不知道我错过了什么,因为我是新手。。这是我到目前为止的基本设置 在我的php ini文件上 zend_extension = "c:/wamp/bin/php/php5.3.8/zend_ext/php_xdebug-2.1.2-5.3-vc9-x86_64.dll" [xdebug

我在使用xdebug和netbeans配置进行远程调试时遇到问题

我可以在本地主机上使用xdebug和netbeans进行调试,效果非常好。。但是在远程服务器上,当我设置断点并调试文件时,它不会在任何断点上停止。我不知道我错过了什么,因为我是新手。。这是我到目前为止的基本设置

在我的php ini文件上

zend_extension = "c:/wamp/bin/php/php5.3.8/zend_ext/php_xdebug-2.1.2-5.3-vc9-x86_64.dll"

[xdebug]
xdebug.remote_enable = 1
xdebug.remote_host=localhost
xdebug.remote_handler = dbgp
xdebug.remote_connect_back = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
在我的netbeans上,我已经配置了远程连接,并且可以很好地使用该连接。下面是运行配置的设置

Run As = Remote Web Site (FTP, SFTP)
Project Url =  http://www.somewebsite.com/
Index File = index.php
Arguments = none since it has n arguments at first

inside Remote Connection :  
host Name = host IP(eg 69.123.123.123)
encryption = Pure Ftp
username = someuser
password = somepassword
initial directory = /
timeout = 30
keep alive interval = 30
Passive mode = checked

Upload directory = blank
Upload Files = manually

希望有人能帮我指出我遗漏了什么,该怎么做,我几乎不了解这方面的一些技术配置,如果你能帮助我一步一步地完成,我知道我可以遵循。期待这一天。谢谢

您需要进行路径映射,否则netbeans会在错误的路径上设置断点。如果您创建远程日志文件(http://xdebug.org/docs/all_settings#remote_log)您将看到它在哪些路径上设置断点。有关路径映射的信息,请参阅。

您必须将远程主机设置为运行Netbeans的计算机的名称或IP,而不是本地主机

xdebug.remote\u host=localhost

更改为,例如:

xdebug.remote_host=192.168.0.10

原因是,服务器上的Xdebug将尝试连接到Netbeans机器进行调试,而不是相反,因此服务器需要知道“远程”机器的地址

哦,还要确保您的本地windows防火墙允许从端口9000上的服务器进行连接