为 phpstrom 配置 Zend debugger 来调试代码

aries 发表于 2012-10-08 1542 次浏览 标签 : phpstromzend debugger

首先,下载Zend debugger(我这里就直接给出地址了,省得去官网下载还需要注册登录)

下载地址:http://pan.baidu.com/share/link?shareid=72062&uk=4161689458

下载完成后,选择你相应的版本,然后在你的php.ini中添加如下代码:

[Zend]
zend_extension_ts="D:serverszendDebugger.dll" 
zend_debugger.allow_hosts=127.0.0.1/32,127.0.0.1/24 
zend_debugger.expose_remotely=allowed_hosts

重启你的Apache或者IIS,看下phpinfo中的zend debugger信息吧!

然后,打开你的phpstrom,我的版本是phpstrom5。


File->Settings->PHP->Servers 为 phpstrom 配置 Zend debugger 来调试代码

红框的部分是需要你填写的,Debugger选择Zend debugger。

填写完成以后点击按钮**“Apple”** 。

再选择Servers下面的Debug,看Zend debugger的配置选项,Debug port和Settings broadcasting port这两项基本不用动,然后点击

为 phpstrom 配置 Zend debugger 来调试代码

Use debugger bookmarklets to initiate debugging from your favorite browse

在Zend debugger项中填写相关信息,Port不用动,因为我们在phpstrom中就没有修改是默认的(10137),

IP:这个我改成了localhost,因为我们在配置Servers的时候,host中填写是的localhost,然后点击**"Generate"** 按钮

下面会产生几个链接,把这些链接都添加到你的默认浏览器书签或者收藏夹中去

为 phpstrom 配置 Zend debugger 来调试代码

到此,大功告成。

只要在访问指定的调试服务器上的应用程序时,先在phpstrom中点击 Run->Start Listen PHP Debug connection按钮,

启动对调试端口的监听,点击书签中的Start debugger,开启debug功能,再点击Debug this page、Debug next page或Debug all post,即可调用phpstrom,对程序进行调试,增删断点、显示当前状态下变量和表达式的值,非常的方便。

0条评论

如需评论,请填写表单。
换一个

记住我的信息