php7 xdebug,php7.0、phpstorm使用xdebug

一、查看当前php环境信息

ab67535ccbdd?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

二、安装php xdebug扩展

我下载Xdebug 2.6.1稳定版

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

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

文件:PHP 7.0 VC14 (64 bit)

ab67535ccbdd?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

--配置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的配置。

ab67535ccbdd?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

ab67535ccbdd?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

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

IDEkey:填PHPSTORM,

host填test.shuchengxian.com,

port填9000

ab67535ccbdd?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

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

如:name填test.shuchengxian.com,

host填test.shuchengxian.com,

port填80,

debugger选XDebug

ab67535ccbdd?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

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

Server选填test.shuchengxian.com,

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

Browser 默认或者选chrome

ab67535ccbdd?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

ab67535ccbdd?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

运行项目

ab67535ccbdd?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值