wamp、zend studio安装xdebug进行调试

PHP安装

  • xdebug官方给出了一个分析php对应版本安装xdebug的分析指导。首先新建一个php文件,使用echo输出php的信息

echo phpinfo()

然后到官方网站https://xdebug.org/wizard.php,将输出的所有信息拷贝到:

image.png

接着,点击分析,就会指导你改下什么版本的xdebug版本

我本地使用的php版本为php 7.2.13,很遗憾,我放进去分析没有分析出指导结果,所以自己就根据版本到官网下载页下载7.2的版本。经过一番尝试,最终下载了如下版本:

image.png

接着,配置php.ini里的xdebug配置:

[xdebug]
zend_extension ="c:/wamp64/bin/php/php7.2.13/zend_ext/php_xdebug-2.7.0-7.2-vc15-x86_64.dll"
xdebug.remote_enable =true
xdebug.remote_host="localhost"
xdebug.remote_port=9001
xdebug.remote_handler = "dbgp"

重启wamp,这时候再输出phpinfo(),可以看到下图所示,即配置成功:


image.png

Zend Studio配置

  • 打开配置菜单:window->preference->PHP->PHP Executables,如下:


    image.png

    点击增加,如下图,进行配置:


    image.png

    SAPI类型选择CLI
image.png

点击OK保存,然后将这个执行改为默认行为:


image.png

接下来,在Service中新加一条:


image.png

image.png

image.png

这是我本地xdebug的配置,具体到各个版本环境,可能有些许差异。稍微调整下问题不大。

参考:
http://files.zend.com/help/Zend-Studio/content/configuring_xdebug.htm

你可能感兴趣的:(wamp、zend studio安装xdebug进行调试)