php7.0、phpstorm使用xdebug

一、查看当前php环境信息


二、安装php xdebug扩展

我下载Xdebug 2.6.1稳定版

在phpinfo中看到电脑是x64的,所以选择64位的下载。

官网:https://xdebug.org/download.php

文件:PHP 7.0 VC14 (64 bit)

--配置xdebug

将php_xdebug-2.6.0-7.0-vc14-nts-x86_64.dll复制到PHP扩展目录中,对应的目录根据实际情况来。

在php.ini中添加配置

[XDebug]

zend_extension=php_xdebug.dll

xdebug.profiler_enable = On

xdebug.profiler_enable_trigger = 0

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

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

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

xdebug.remote_enable = On

xdebug.remote_handler = "dbgp"

xdebug.remote_host = "127.0.0.1"

xdebug.remote_port = 9000

xdebug.remote_mode = "req"

xdebug.collect_vars = On

xdebug.collect_return = On

xdebug.collect_params = On

xdebug.idekey = PHPSTORM

xdebug.auto_trace=On

xdebug.remote_autostart=On

xdebug.remote_log="G:\phpStudy\tmp\xdebug.log"

重启下环境,打印phpinfo(),查看有没有XDebug扩展。

三、配置phpstorm

3.1 打开phpStorm,快捷键Clt+Alt+S打开settings搜索Xdebug.选择下php7环境以及看下xdebug的配置。

3.2 进入Settings>PHP>Debug>DBGp Proxy。

IDEkey:填PHPSTORM,

host填test.shuchengxian.com,

port填9000

3.3 进入Settings>PHP>Servers,这里要填写服务器端的相关信息,

如:name填test.shuchengxian.com,

host填test.shuchengxian.com,

port填80,

debugger选XDebug

3.4 进入Run> Debug configurations,点+号选择PHP Web Application,

Server选填test.shuchengxian.com,

Start URL填你要访问的页面(如:/index.php), 

Browser 默认或者选chrome

 运行项目

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 【已经有作者发过类似的文章了,流程不是太详细,这里做个补充吧,也是自己的备忘!】 PHP 开发的时候,频繁的调试,...
    野尘lxw阅读 5,345评论 2 10
  • 1、打开php.ini(phpstudy中,其它选项菜单>打开配置文件>php.ini) 找到XDebug,修改为...
    奋斗_登阅读 1,160评论 0 0
  • CentOS7下安装和使用Xdebug下载地址:https://xdebug.org/files/(选择自己需要的...
    我的楼兰0909阅读 497评论 0 0
  • 用到的工具:phpstudy + vscode vscode设置为中文方法: 1.shift + ctrl + p...
    爱的伤心醉阅读 12,086评论 0 1
  • 母亲节,都在说妈妈,我也说说吧。 以前年纪小,没有觉得妈妈对自己有什么大的影响,年岁渐长,才发觉妈妈对每个孩子的影...
    孙岳阅读 327评论 0 0