您的位置:首页 > 理论基础 > 计算机网络

Eclipse集成PDT+XDebug调试PHP脚本 https://svn.jcxsoftware.com/node?page=5 [转]

2014-03-27 14:02 127 查看
win7+xampp-win32-1.8.2-2-VC9+eclipse-jee-indigo-SR2-win32-x86_64.zip

http://pjdong1990.iteye.com/blog/1610305

http://pan.baidu.com/share/link?shareid=2741342437&uk=571615461&fid=943296216

搭建 Xampp + Eclipse PDT + XDebug 的PHP调试环境

,如果你机器没有JRE,来JAVA的官方网站下载JRE,安装,因为Eclipse需要JRE才能运行。

2,下载Eclipse PDT,直接下载下面的那个3.0.x版本的All in one windows安装包。直接运行eclipse就可以启动。

3,下载XAMPP这个集成的PHP+MySql运行环境。

[XDebug]
zend_extension = "E:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "E:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 19000
xdebug.remote_autostart = 1
xdebug.overload_var_dump = 1
xdebug.var_display_max_children = 1024
xdebug.var_display_max_data = 2048
xdebug.var_display_max_depth = 10
xdebug.auto_trace = 1
xdebug.show_exception_trace = 1
xdebug.collect_vars = 1
xdebug.collect_return = 1
xdebug.collect_params = 1

4,在c:\xampp\php\php.ini文件里面去掉XDebug的注释,并把所有0改为1
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "C:\xampp\tmp"

5,Eclipse的配置。

依次打开Windows -> Preferences -> PHP ->PHP Executables 加入XDebug



依次打开Windows -> Preferences -> PHP ->Debug,配置如下



然后在debug configuration 里面配置如下:



下面调试成功后的界面如下所示:



如果以上不能解决问题,有可能是网上说的端口被占用的原因,网上给出的解决方案是:

1)修改php.ini

xdebug.remote_port=9001 ;反向连接zend studio使用的端口

2) 修改zend studio 的XDebug反向链接端口

Window -> Preferences -> PHP -> Debug -> Installed Debuggers

注意:svn接口换成svnkit的,JNI接口不稳定。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: