phpstrom + xdebug 的版本网上很多,有点小乱,我照着做踩了坑,如下图:
一直报不能加载xdebug,现在算是解决了。
现在将我的配置过程与大家分享:
步骤一:
查看phpinfo()信息确定版本号,我这里用的是5.6.27-nts 32bit的
去官网https://xdebug.org/download/historical 下载对应dll文件
我这里下载的php_xdebug-2.4.0rc4-5.6-vc11-nts.dll是这个
把下载的文件放到php目录下的ext目录。
步骤二:
配置php.ini文件
[XDebug]
xdebug.profiler_output_dir="E:\phpstudy2018\PHPTutorial\tmp\xdebug"
xdebug.trace_output_dir="E:\phpstudy2018\PHPTutorial\tmp\xdebug"
;zend_extension="D:\Program Files\phpStudy20161103\php\php-5.6.27-nts\ext\php_xdebug.dll"
zend_extension="E:\phpstudy2018\PHPTutorial\php\php-5.6.27-nts\ext\php_xdebug-2.4.0rc4-5.6-vc11-nts.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1;开启xdebug
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_name = "cachegrind.out.%t.%p"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9001
xdebug.idekey = PHPSTORM
然后phpinfo.php 查看xdebug是否配置成功
步骤三:
配置phpstrom,不多说,上图:
配置php.exe执行文件,网上很多文档都说要配置debugger extension,但是我配置了都问题。
9001要和php.ini中的 xdebug.remote_port 一致。
填写访问的web的地址和端口。
配置服务。
右上角:
配置浏览器。
当然浏览器需要安装xdebug-helper,我是扶梯子 直接下载的。
配置好了。
选择刚刚建好的,设置断点,浏览器直接访问,或者点击debug都可以。