【发布时间】:2013-10-01 06:15:09
【问题描述】:
我在phpstorm 中设置了php.ini 和Debug 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。
【问题讨论】:
-
"Port 9000 is busy" - 这意味着另一个应用程序(不是 PhpStorm .. 或完全不同的 PhpStorm 实例)已经在该端口上侦听。 IDE 在该端口上侦听(接收连接),xdebug 是连接到 IDE 而不是其他方式的那个。 xdebug 官方文档详细解释了 xdebug 如何与调试客户端 (IDE) 一起工作:xdebug.org/docs/remote
标签: php linux port xdebug phpstorm