gpt4 book ai didi

php - 运行 script.php 时出错 : Port 9000 is busy

转载 作者:IT王子 更新时间:2023-10-28 23:52:17 24 4
gpt4 key购买 nike

我在 phpstorm 中设置了 php.iniDebug config。尝试调试 phpstorm 事件日志中的 php 脚本输出:

"Error running script.php: Port 9000 is busy"

php.ini 结束:

        [XDebug]
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_port="9000" (the default port is 9000)
xdebug.profiler_enable=1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir="/etc/php5/xdebug/profiler_output_dir"

pStorm 中的调试端口也设置为 9000。netstat -na 输出:

tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN 

如果我设置到其他端口呢?例如,将其设置为 10001 似乎可以完成这项工作。或者只是如何让它正常工作。我不确定我是否了解 xDebug 的工作原理。就像在文件中设置断点的 phpstorm 中运行 Debug("script.php")(Shift+F9) 一样?

有人有想法吗?

编辑:

来自: http://xdebug.org/docs/remote

xdebug.remote_port
Type: integer, Default value: 9000
The port to which Xdebug tries to connect on the remote host. Port 9000 is the default for both the client and the bundled debugclient. As many clients use this port number, it is best to leave this setting unchanged.

如果我将端口更改为 9000 以外的端口怎么办?也许超过 50k。

最佳答案

在端口 9000 上运行的进程可能是 PhpStorm 本身。

像 Jacob 提到的那样检查当前使用的端口(在 Windows cmd 上:netstat -a -b): enter image description here

如果 PhpStorm.exe 列在 :9000 下,您只需在设置 > 构建中更改内置服务器 的端口,执行、部署 > 调试器 到例如63342(这是我的队友 PhpStorm 安装的默认设置)。

关于php - 运行 script.php 时出错 : Port 9000 is busy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19109240/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com