简体   繁体   English

无法在Netbeans中运行PHP调试-XDebug

[英]Cannot run PHP debugging in Netbeans - XDebug

I have Netbeans 7.0.1 IDE, running on Windows 7 64-bit . 我有在Windows 7 64位上运行的Netbeans 7.0.1 IDE。 I have installed the PHP through XAMPP 1.7.2 . 我已经通过XAMPP 1.7.2安装了PHP。 Running phpinfo() shows PHP version as 5.3.1 and XDebug version as 2.0.6-dev . 运行phpinfo()显示PHP版本为5.3.1 ,XDebug版本为2.0.6-dev

A web-page on netbeans.org has mentioned some entries to be uncommented in php.ini file, and has mentioned that compatible XDebug.dll is already provided with the setup. netbeans.org上的网页上提到了php.ini文件中不需要注释的一些条目,并且提到安装程序已经提供了兼容的XDebug.dll。 These are entries from the php.ini file... 这些是来自php.ini文件的条目...

[PECL]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"

[XDebug]
xdebug.remote_port = 9000
xdebug.remote_host = 127.0.0.1
xdebug.remote_handler = "dbgp"
xdebug.remote_enable = 1
xdebug.profiler_enable = 0
xdebug.profiler_append = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_name = "xdebug_profile.%p"
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.trace_output_dir = "C:\xampp\tmp"
xdebug.idekey = "netbeans-xdebug"

Heres is the snapshot of the debugger configuration from Netbeans IDE. 这是Netbeans IDE中调试器配置的快照。 在此处输入图片说明

The Sessions debugger window doesn't show netbeans-xdebug session running. 会话调试器”窗口不显示netbeans-xdebug会话正在运行。 在此处输入图片说明

After all these settings, the debugger is still not running. 完成所有这些设置后,调试器仍未运行。

I checked the ports using TCPView and it shows that port 9000 is free. 我使用TCPView检查了端口,结果表明端口9000是可用的。 Also the firewall is disabled. 防火墙也被禁用。

Any help please? 有什么帮助吗?

I know this question is old, but I had a similar problem, and my setup looked identical to yours except I'm on Ubuntu. 我知道这个问题很旧,但是我有一个类似的问题,除了我在Ubuntu上,我的设置与您的设置相同。 I was able to get it working by simply making it a PHP project within Netbeans; 我可以通过简单地使其成为Netbeans中的PHP项目来使其工作。 apparently you cannot debug a single file. 显然,您无法调试单个文件。

You can create a project from an existing codebase and even store the project metadata elsewhere, by doing File->New Project. 您可以通过执行File-> New Project,从现有代码库创建项目,甚至将项目元数据存储在其他位置。

Here is a snippet from my PHP.ini file: 这是我的PHP.ini文件中的片段:

[xdebug]
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.profiler_enable = On
xdebug.profiler_output_dir = /tmp
xdebug.dump_globals=On
xdebug.show_exception_trace=On
xdebug.collect_params=4

Make sure you restart the server and Netbeans after editing PHP.ini. 确保在编辑PHP.ini之后重新启动服务器和Netbeans。

[zend]
zend_extension = "path_to_xdebug"
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.profiler_enable = On 
xdebug.profiler_output_dir = C:\Windows\temp 
xdebug.dump_globals=On 
xdebug.show_exception_trace=On 
xdebug.collect_params=4

Try this. 尝试这个。 Save php.ini. 保存php.ini。 Restart PC. 重新启动电脑。

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

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