eclisep+pdt+xdebug搭建PHP调试环境

我的PHP版本:php-7.0.12-nts

执行phpinfo();如果没有图中这一块内容就是没有安装Xdebug了

进入这条连接:https://xdebug.org/wizard.php

将phpinfo()信息输入文本框中,点击提交,然后你会得到如下提示:

如果告诉你让你去下载VC11或者VC14运行库,直接去微软官网下载即可:

https://www.microsoft.com/zh-cn/

搜索VC11和VC14,它们分别对应:

Visual C++ Redistributable for Visual Studio 2012 Update 4和Visual C++ Redistributable for Visual Studio 2015

按照提示去操作即可,然后再次输出你的phpinfo()信息,你应该会看到这些东西:

eclipse搭建PHP运行环境:

help->install new softwares->work with

填​​php - http://download.eclipse.org/tools/pdt/updates/4.2​

选择安装​​PHP Development Tools​​即可

然后再在windows->preferences->php中设置php executeable和Debug即可

修改php.ini内容:

xdebug.profiler_append = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir="C:\phpStudy\PHPTutorial\tmp\xdebug"
xdebug.trace_output_dir="C:\phpStudy\PHPTutorial\tmp\xdebug"
zend_extension="C:\phpStudy\PHPTutorial\php\php-7.0.12-nts\ext\php_xdebug-2.6.1-7.0-vc14-nts.dll"
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_port=9000
# 开启所有站点xdebug调试
xdebug.remote_connect_back=1

根据实际情况修改路径