phpstorm xdebug配置

2014-04-19 20:30:00
1147533288
原创
1570
摘要:phpstorm,xdebug
1.新建phpinfo.php
<? phpinfo(); ?>
访问localhost/phpinfo.php显示对应php信息。

2.拷贝整个页面至http://www.xdebug.org/find-binary.php,提交后显示如下建议(我的php使用5.3版本,对应给出配置如下):
<!--more-->
Instructions

Download php_xdebug-2.2.4-5.3-vc9.dll

3.下载php_xdebug-版本.dll至php安装目录/ext下,修改php.ini配置文件,增加如下信息(zend_extension注意改成对应的dll):
;onload Xdebug
zend_extension = "D:\php5.3\ext\php_xdebug-2.2.4-5.3-vc9.dll"
;xdebug configuration
[Xdebug]
xdebug.remote_enable   = On
xdebug.remote_host     = "localhost"
xdebug.remote_port     = 9000
xdebug.remote_handler  = "dbgp"
xdebug.auto_trace = 1
xdebug.collect_i n c l u d es = 1
xdebug.collect_params = 1
xdebug.collect_return = 1
xdebug.default_enable = 1
xdebug.collect_assignments = 1
xdebug.collect_vars = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.show_local_vars = 1
xdebug.show_exception_trace = 0

4.重启apache服务
5.phpstorm->file->setting,设置php->servers添加server,添加断点,开启run旁边的监听按钮,调试页面。


2018-02-11更新:php5.6版本使用xdebug

xdebug官网提示不支持php7以下版本,但是翻阅后可以看到各个历史版本的xdebug,根据php版本号自行下载xdebug.dll文件,放入php目录ext下。

php.ini文件增加

;onload Xdebug
zend_extension = "D:\php\php5.6\ext\php_xdebug-2.5.5-5.6-vc11.dll"
;xdebug configuration
[Xdebug]
xdebug.profiler_output_dir="D:\php\xdebug"
xdebug.trace_output_dir="D:\php\xdebug"
xdebug.remote_enable=On  //开启远程调试  
xdebug.var_display_max_children=128  
xdebug.var_display_max_data=51200000  
xdebug.var_display_max_depth=5  
xdebug.remote_connect_back = 1  
xdebug.remote_autostart = 1  
xdebug.remote_port=9000  
xdebug.idekey="PHPSTORM"

phpstorm中phpxdebug端口填9000,idkey填PHPSTORM,地址填localhost,新建server,php web application,加断点,启动apache httpd,启动debug验证。

文章分类
联系我
联系人: meepo
电话: *****
Email: 1147533288@qq.com
QQ: 1147533288