无法正确安装 Xdebug
我尝试为我的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否还有其他东西在端口 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.