php7 xdebug 配置,如何配置phpstorm xdebug phpstudy php7

环境要求:

phpstorm2018.2.2

phpstudy php7

Xdebug v2.6.1

一、查看当前php环境信息

da5fe9afac742f5c30538fdba53f4765.png

图中圈中的地方是我们要注意的,下载的对应的扩展。

二、开始安装redis扩展

2.1 下载redis配置文件

我这边还用到了redis,所以再配置下redis的扩展。

由于官网上都是php7版本,所以我直接就使用php7环境了。

官网:http://pecl.php.net/package/redis

下载文件:7.0 Non Thread Safe (NTS) x86

我下载了redis3.1.6稳定版,再选择redis下载版本的时候,切记要看下当前php的线程模式。

补充:

TS指Thread Safety,即线程安全,一般在IIS以ISAPI方式加载的时候选择这个版本。

NTS即None-Thread Safe,一般以fast cgi方式运行的时候选择这个版本,具有更好的性能。

4b01efdf67f10f90678da832f8f574c3.png

2.2 在php.ini中配置扩展

将php_redis.dll复制到G:\phpStudy\php70n\ext扩展目录中,对应的目录根据实际情况来。

在php.ini中添加配置extension=php_redis.dll

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

三、安装php xdebug扩展

3.1

我下载Xdebug 2.6.1稳定版

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

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

文件:PHP 7.0 VC14 (32 bit)

573c752fb5afd5a57ce6bd2ad7566734.png

3.2 配置xdebug

将php_xdebug.dll复制到G:\phpStudy\php70n\ext扩展目录中,对应的目录根据实际情况来。

在php.ini中添加配置[XDebug]zend_extension=php_xdebug.dllxdebug.profiler_enable = Onxdebug.profiler_enable_trigger = 0xdebug.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 = Onxdebug.remote_handler = "dbgp"xdebug.remote_host = "127.0.0.1"xdebug.remote_port = 9000xdebug.remote_mode = "req"xdebug.collect_vars = Onxdebug.collect_return = Onxdebug.collect_params = Onxdebug.idekey = PHPSTORMxdebug.auto_trace=Onxdebug.remote_autostart=Onxdebug.remote_log="G:\phpStudy\tmp\xdebug.log"

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

四、配置phpstorm

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

b8f3128dfa3517fbb4e7905a725655c0.png

7c66d59afdcc3d9ff9bc5202daa42d47.png

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

IDEkey:填PHPSTORM,

host填test.shuchengxian.com,

port填9000

2164eab6531255367393e75df3655513.png

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

如:name填test.shuchengxian.com,

host填test.shuchengxian.com,

port填80,

debugger选XDebug

592c7d05c8900a96231ac1945134b044.png

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

Server选填test.shuchengxian.com,

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

Browser 默认或者选chrome

2018111542181202301585.png

b2a7df463550455a1388186551ead5ec.png

4.4 运行项目

3b72264be2e6b1b0c052e5797bc9a209.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值