无法正确安装 Xdebug

发布于 2025-01-07 19:04:45 字数 1295 浏览 1 评论 0原文

我尝试为我的 PHP 项目安装 Xdebug,但我认为它们出了问题。当我运行在 NetBeans 文档页面 上找到的脚本时,我收到错误

Only one usage of each socket address (protocol/network address/port) is normally permitted.

: ,当我检查 Xdebug 安装指南 时,Xdebug 已安装并正常工作。

我使用 NetBeans 中的这个脚本来检查:

$address = '127.0.0.1';
$port = 9001;
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
$result = socket_bind($sock, $address, $port);
if (!$result) {
    echo(var_dump(socket_strerror(socket_last_error())));
    die('Unable to bind');
}
socket_listen($sock);
$client = socket_accept($sock);
echo "connection established: $client";
socket_close($client);
socket_close($sock);

这是我配置 Xdebug 的 php.ini

; Xdebug enabled...
zend_extension = C:\Server\PHP\5.3.8\ext\php_xdebug-2.1.3-5.3-vc9.dll
xdebug.profiler_enable = Off
xdebug.default_enable = On
; Xdebug remote...
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_port = 9001
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 512
xdebug.var_display_max_depth = 4

非常欢迎任何有关如何正确处理事情的建议!

I tried to install Xdebug for my PHP project, but I supposed their was something wrong. And when I ran the script bellow I found on document page of NetBeans, I get the error:

Only one usage of each socket address (protocol/network address/port) is normally permitted.

Although, when I check with Xdebug install guide, Xdebug is installed and working.

I used this script from NetBeans to check:

$address = '127.0.0.1';
$port = 9001;
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
$result = socket_bind($sock, $address, $port);
if (!$result) {
    echo(var_dump(socket_strerror(socket_last_error())));
    die('Unable to bind');
}
socket_listen($sock);
$client = socket_accept($sock);
echo "connection established: $client";
socket_close($client);
socket_close($sock);

And this is my php.ini where I configured Xdebug:

; Xdebug enabled...
zend_extension = C:\Server\PHP\5.3.8\ext\php_xdebug-2.1.3-5.3-vc9.dll
xdebug.profiler_enable = Off
xdebug.default_enable = On
; Xdebug remote...
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_port = 9001
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 512
xdebug.var_display_max_depth = 4

Any advice how to get things right would be very welcome!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

放血 2025-01-14 19:04:45

您是否还有其他东西在端口 9001 上运行,例如 Web 服务器?我会尝试将端口更改回默认配置中的端口。

Do you have anything else running on port 9001 such as a web server? I would try changing the port back to what it was in the default configuration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文