phpStudy + PhpStorm + XDebug调试

一、XDebug安装配置

(1)下载XDebug下载地址:http://www.xdebug.org/必须下载跟机器上安装的php匹配的版本才行。具体下载方法如下:将phpinfo网页的源代码拷贝到http://www.xdebug.org/find-binary.php,然后按照指导安装即可。如下图所示:

 

 

(2)安装XDebug按照上图下载“php_xdebug-2.3.2-5.4-vc9.dll”,将其复制到F:\phpstudy\php\php-5.5.38\ext目录。

(4)验证安装是否成功检测方法1:在phpinfo网页中,能够检索到XDebug字样,就安装成功了,如下图所示:

检测方法2:

在cmd下输入php -m,能看到XDebug说明配置成功。如下图所示:

1、phpStudy配置

phpStudy集成XDebug扩展,所以不用下载XDebug

phpStudy -> 其它选项菜单-> PHP扩展及设置-> PHP扩展 -> Xdebug

2、修改php.ini文件

[XDebug]

xdebug.profiler_append = 0

 

;效能监测的设置开关

xdebug.profiler_enable = 1

xdebug.profiler_enable_trigger = 0

 

;profiler_enable设置为1的时候,效能监测信息写入文件所在的目录

xdebug.profiler_output_dir="D:\phpStudy\tmp\xdebug"

 

;设置的函数调用监测信息的输出路径

xdebug.trace_output_dir="D:\phpStudy\tmp\xdebug"

 

;生成的效能监测文件的名字

xdebug.profiler_output_name ="cache.out.%t-%s"

 

; IDE与XDebug协作

xdebug.remote_enable = 1

xdebug.remote_handler = "dbgp"

xdebug.remote_host = "127.0.0.1"

xdebug.remote_port = 9000

xdebug.idekey = phpstorm-xdebug

 

;.dll文件的路径

zend_extension="D:\phpStudy\php\php-5.4.45-nts\ext\php_xdebug.dll"

 

3、phpstorm配置

1)选择PHP版本

文件 ->设置 –>语言和框架 –> PHP

2)Debug端口

“Debug port”与php.ini中xdebug.remote_port值一致

3)配置host端口

IDE key与 php.ini中xdebug. idekey值一致

Port与 php.ini中xdebug.remote_port值一致

 

4)设置服务器

5)运行 -> 编辑配置–> PHP Web Application

 

4、开始XDebug调试

在phpStorm里打开监听,就是一个电话一样的按钮,点击变为绿色,在程序代码点前点击,设置程序段点,点击绿色的debug爬虫按钮,chrome浏览器打开xdebug页,phpStorm出现debug窗口,并获取到variables值

  

技术分享

技术分享

技术分享

技术分享

--------------------- 
作者:weixin_40418199 
来源:CSDN 
原文:https://blog.csdn.net/weixin_40418199/article/details/79088365 
版权声明:本文为博主原创文章,转载请附上博文链接!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值