2013-07-18 172 views
9

使用PhpStorm与Xdebug的PHP的调试时,我搜索了很多对于这个问题有IDE关键传入的连接,我发现3个或4个环节讨论这个问题,但他们都不是useful.My的Xdebug的版本是2.2.3,PhpStorm的版本是6.03。我可以通过调试每一步踩线,除了这一个Xdebug的PhpStorm:等待

$this->link = mysql_connect($this->dbserver, $this->dbuser, $this->dbpass); 

PhpStorm显示了这个错误:等待与IDE键“14841”传入的连接。 这里是我的XDebug配置:

zend_extension="/usr/lib/xdebug.so" 
xdebug.remote_autostart=1 
xdebug.show_local_vars=1 
xdebug.dump.GET=* 
xdebug.dump.POST=* 
xdebug.dump.SERVER=* 
xdebug.auto_trace=On 
; default trace output directory /tmp 
xdebug.collect_vars = On 
xdebug.trace_output_dir=/tmp 
xdebug.collect_params=4 
xdebug.collect_return=On 

xdebug.profiler_enable=Off 
; default trace output directory /tmp 
;xdebug.profiler_output_dir=/tmp 
;xdebug.profiler_enable_trigger=On 
;test.php?XDEBUG_PROFILE 
xdebug.remote_enable=On 
xdebug.remote_host="localhost" 
xdebug.remote_port=9001 
xdebug.remote_handler="dbgp" 
xdebug.remote_log = "/tmp" 
xdebug.remote_connect_back=1 
xdebug.idekey=PHPStorm 

我添加这些行“xdebug.remote_connect_back = 1 xdebug.idekey = PHPStorm”,也可以抵抗IDE,它仍然是相同的 我保证,这三个参数是正确的。

回答

4

您写道:

PhpStorm shows this error:Waiting for incoming connection with ide key "14841".

但你使用:

xdebug.idekey=PHPStorm 

这些IDE钥匙需要匹配。 PHP Storm对此有点有趣。

但你也说:

I could debug every line step by step except this one

$this->link = mysql_connect($this->dbserver, $this->dbuser, $this->dbpass); 

他们如何不同?是否有不同的行为,或只是不停止?

+0

谢谢,我发现原因后来,我注意到,我忘了安装mysql.so extension.so此功能失败。 –

+13

好吧,但是如何让phpstorm使用idekey“PHPStorm”而不是随机数? – Andrew

+0

这与上面没有任何关系。请检查我的帖子下面 –

1

我有在本地安装一个类似的问题。 我固定它通过取消选中该设置:使用路径映射

设置下找到>语言&框架> PHP>服务器

+0

这是我的问题。谢谢! – racl101

+0

你为什么认为解决了它?你没有使用符号链接? – RichieHH

6

对于我来说,调试器从未连接,我看到了等待与IDE传入的连接关键消息,因为我设置为我设置服务器配置端口号为9000 这应设置为端口80(或任何其他端口的网络服务器是听!这是令人困惑的我,因为它旁边的调试器下拉,我想通这是设置Xdebug的端口。

You do NOT want to set this value to the debug port

调试端口配置在设置 - >语言联合&框架 - > PHP->调试。设置为9000或任何你配置php.ini。

Set Debug port to 9000 in PHP Debug settings

刚一说明,我使用的IntelliJ IDEA,但是这一切都JetBrains的平台。

0

我有一个类似的问题。在我的情况下,它是由误解PHPStorm/PHP的IntelliJ调试模式引起的。有两种模式:

  1. “本地” PHP调试
  2. “远程” PHP调试

当您使用 “本地” 调试,IDE关键是自动生成的

这意味着,在http://www.jetbrains.com/phpstorm/marklets/创建的原始小书签在本地模式下不会工作:小书签包含硬编码的IDE密钥,但PHPStorm将生成一个rand一个!

解决方案是在“运行/调试配置”中启用“远程”PHP调试模式(目前称为“PHP远程调试”),并在创建启动配置的右窗格中设置IDE密钥。

全局设置中的“DBGp代理”可能不是您想要的;创建一个“远程”调试配置并在那里设置IDE密钥。