Home  >  Article  >  Backend Development  >  PDT + Xdebug 调试 PHP

PDT + Xdebug 调试 PHP

WBOY
WBOYOriginal
2016-06-23 14:33:12935browse

环境:

PHP Version 5.2.9-1

Apache 2.2.11

Mysql5.0

 

PDT(PHP Development Tools)

http://www.eclipse.org/pdt/downloads/ 

下载pdt all-in-ones,我下的版本是pdt-all-in-one-win32-2.0.0GA.zip

 

http://www.xdebug.org/download.php

下载xdebug,对应的php版本,由于我的是php5.2.9

xdebug没有对应的5.2.9。所以选择5.2.5或者5.2.8(之前下过5.3.0,没有配置成功)

php_xdebug-2.0.3-5.2.5.dll 或 php_xdebug-2.0.4-5.2.8.dll

 

将xdebug放进C:\Program Files\PHP\ext目录

修改php.ini配置,加入xdebug的配置信息:

[Xdebug]  
;extension=php_xdebug-2.0.3-5.2.5.dll  ;这里可是花了大半天的时间,无法调试断点,断点不起作用,Xdebug必须得使用zend_extension_ts来挂载
zend_extension_ts="C:/Program Files/PHP/ext/php_xdebug-2.0.3-5.2.5.dll"
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.trace_output_dir="c:/Program Files/PHP/debuginfo" ;这个目录默认是没有的,必须手动去创建
xdebug.profiler_output_dir="c:/Program Files/PHP/debuginfo"

 

重启apache,具体调试方式可参考下面链接:

玩转PHP调试:PHP Debug 

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn