1.下载xdebug文件php
https://xdebug.org/download.phpweb
必定下载与本身PHP版本想匹配的xdebug文件chrome
好比 个人是php版本 64位 5.6.21 apache
下载是(PHP 5.6 VC11 TS (64 bit) )ts 表示线程安全版本浏览器
2.配置php.ini,在末尾加上。安全
;xdebug配置
[Xdebug]
;载入Xdebug
zend_extension="D:/xampp/php/ext/php_xdebug.dll"
xdebug.idekey="PHPSTORM"
;开启自动跟踪
xdebug.auto_trace = On
xdebug.profiler_enable=on
;xdebug 的数据文件目录
xdebug.trace_output_dir="D:/xampp/php/debuginfo"
;xdebug 的数据文件目录
xdebug.profiler_output_dir="D:/xampp/php/debuginfo"
;开启异常跟踪
xdebug.show_exception_trace = On
;开启远程调试自动启动
xdebug.remote_autostart = Off
;开启远程调试
xdebug.remote_enable = On
;用于zend studio远程调试的应用层通讯协议
xdebug.remote_handler=dbgp
;容许链接的zend studio的IP地址
xdebug.remote_host=localhost
;反向链接zend studio使用的端口
xdebug.remote_port=9090
;收集变量
xdebug.collect_vars = On
;收集返回值
xdebug.collect_return = On
;收集参数
xdebug.collect_params = On
;若是设得过小,函数中有递归调用自身次数太多时会报超过最大嵌套数错
xdebugbug.max_nesting_level = 10000服务器
保存文件,从新启动apache检查是否成功开启了xdebug服务。ide
一种方法为在CMD里输入D:\xampp\php\php.exe -m 看到XDebug,说明成功开启XDebug。函数
另外一种方法为浏览器打开localhost,找到phpinfo()点击打开配置状况,查找xdebug项,找到了说明xdebug配置成功。spa
3.chrome的xdebug配置
下载扩展程序 Xdebug helper
设置
4.phpStorm的相关配置
打开phpStorm,
-进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息,name填localhost,host填localhost,port填80,debugger选XDebug
-进入File>Settings>PHP>Debug,看到XDebug选项卡,port填9090(随意避免端口冲突),其余默认
-进入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 phpStorm,host 填localhost,port 填9090
-点OK退出设置
5.设置监听 和本地web server
-点OK退出设置
至此,本身能够去设置断点进行调试了