调试 PHP,NetBeans 无法与 xdebug v3 一起使用

问题描述 投票:0回答:2

调试 PHP,NetBeans 无法与 xdebug v3 一起使用

我使用的是ubuntu 18

PHP7.4

Xdebug v3.1.2

php-v 
PHP 7.4.28 (cli) (built: Feb 17 2022 16:06:19) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
    with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans

我的xdebug配置是

/etc/php/7.4/mods-available/xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.profiler_enable=1

每次我在 Netebeans 中单击“运行”时,都会收到此消息“正在等待连接”

php ubuntu netbeans xdebug-3
2个回答
0
投票

xdebug V3 的默认端口是 9003,以上所有配置在 xdebug v3 中都被删除了

更换

xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
xdebug.profiler_enable=1

xdebug.log="/var/log/xdebug.log"
xdebug.idekey=netbeans-xdebug
xdebug.mode=debug
outbut_buffering=Off

0
投票

XAMPP控制面板v3.3.0 设置: 每次更改 php.ini 文件后,不要忘记重新启动 XAMPP 服务器。

向 Netbeans 添加了调试器端口 9003:

添加了 PHP 解释器路径:

C:\xampp\php\php.exe

将 xdebug dll 添加到路径中(我将 dll 重命名为“php_xdebug.dll”):

C:\xampp\php\ext\php_xdebug.dll

注意:您可以使用Xdebug dll查找向导

找到正确的dll

将以下设置添加到文件“C:\xampp\php\php.ini”的末尾:

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

xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.client_port = 9003
xdebug.remote_port = 9003
xdebug.idekey = "netbeans-xdebug" 
xdebug.start_with_request = yes
xdebug.mode = debug

如果您想了解有关上述设置的更多信息,请访问 Xdebug 文档 - 所有设置

© www.soinside.com 2019 - 2024. All rights reserved.