当前位置: 代码迷 >> 综合 >> Ubuntu ZDE Debugger
  详细解决方案

Ubuntu ZDE Debugger

热度:57   发布时间:2023-12-08 01:41:09.0

摘自:http://blog.csdn.net/wyyl1/archive/2011/06/07/6528718.aspx 

 

eclipse php 插件(http://wiki.eclipse.org/PDT/Installation):
http://download.eclipse.org/tools/pdt/updates/2.2/milestones

-----------------------------------------------------------------------------------------
http://www.wenhq.com/article/view_635.html
软件开发的断点调试是必不可少,这里介绍ubuntu10.04中eclipse工具中php的调试配置。

本打算配置ZendDebugger 进行调试,配置了老长时间没配置成功,在phpinfo看不到ZendDebugger生效,经查发现是php5.3的问题,必须先卸载,本文介绍使用xdebug了。

 

================================================begin
软件安装太简单了,分别执行如下命令:

sudo apt-get install apache2

sudo apt-get install php5

sudo apt-get install php5-cli

sudo apt-get install php5-xdebug

php的配置:

php.ini在/etc/php5/下的几个文件夹里,应该有三个文件夹:apache2、cli、conf.d,我们应该修改apache2和cli 下的php.ini. 在conf.d下有一个xdebug.ini文件,记录了xdebug的文件路径。

sudo gedit /etc/php5/apache2/php.ini

sudo gedit /etc/php5/cli/php.ini
用超级用户权限分别打开上面说的两个php.ini,添加如下代码

;xdebug配置
[Xdebug]
xdebug.remote_enable = 1
xdebug_remote_host = “localhost”
xdebug.remote_port = 9000
xdebug.remote_handler = “dbgp”
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so

;开启自动跟踪
xdebug.auto_trace = On
;开启异常跟踪
xdebug.show_exception_trace = On
;开启远程调试自动启动
xdebug.remote_autostart = On
;开启远程调试
xdebug.remote_enable = On
;收集变量
xdebug.collect_vars = On
;收集返回值
xdebug.collect_return = On
;收集参数
xdebug.collect_params = On

xdebug.collect_assignments = On

--------------------------------------------------------------------------------------
http://techmania.wordpress.com/2008/07/02/debugging-php-in-eclipse-using-xdebug/

在xdebug.ini中添加下列配置:
sudo gedit /etc/php5/conf.d/xdebug.ini

xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"

重新启动apache:sudo /etc/init.d/apache2 restart 

--------------------------------------------------------------------------------------
http://www.txstudy.com/wap.aspx?nid=2638&cid=11&sp=386

配制eclipse的浏览器

打开eclipse,找到window->preferences->general->web browser,看一下有没浏览器,没有就添加一下,当然是firefox



配制运行及调试选项

window->preferences->PHP->>php executables->add->设置如下

php5/usr/bin/php5 (注意这里要选择php5,不要是php,因为我们安装的是php5-xdebug)

继续配制debug(麻烦啊)

 

=================================end 

 


window->preferences->PHP->run/debug->perspectives->可以找到php script和php web page,分别设置他们的debug,及运行程序。

建立PHP脚本后,最后调试运行

打开Run->Open Debug Dialog ,选择调试所需要用的名称和环境,仔细看一下,应该没问题。

然后就可以单步调试了

 

 

 

Notes:本人是在ZendStudio8.9 ubuntu10.04版本上试用,配置的过程真实麻烦哪!!!有个小工具就好了,呵呵。。。。

==============begin 

==============end部分经过本人验证,十分好用!!!