phpstorm配置xdebug上

获取php对应的xdebug扩展

首先复制你的phpinfo页面信息,然后访问xdebug的官方https://xdebug.org/wizard.php,然后粘贴到内容框中,然后就会返回以下信息(以我的php为例)

Xdebug installed: 2.5.4
Server API: Apache 2.0 Handler
Windows: yes - Compiler: MS VC11 - Architecture: x86
Zend Server: no
PHP Version: 5.6.12
Zend API nr: 220131226
PHP API nr: 20131226
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\Windows
Configuration File: D:\xampp\php\php.ini
Extensions directory: D:\xampp\php\ext

You're already running the latest Xdebug version

But here are the instructions anyway:

Download php_xdebug-2.5.4-5.6-vc11.dll
Move the downloaded file to D:\xampp\php\ext
Update D:\xampp\php\php.ini and change the line
zend_extension = D:\xampp\php\ext\php_xdebug-2.5.4-5.6-vc11.dll
Restart the webserver
If you like Xdebug, and thinks it saves you time and money, please have a look at the donation page.

配置php.ini

打开自己的php.ini文件,在文件底部添加以下配置信息

[Xdebug]
zend_extension="D:\xampp\php\ext\php_xdebug-2.5.4-5.6-vc11.dll"
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_host= localhost
xdebug.idekey = PHPSTORM
xdebug.profiler_enable=1
xdebug.profiler_output_dir="D:\xampp\php\xdebug_log"
  • zend_extension: xdebug扩展的路径

  • xdebug.remote_enable:是否尝试连接一个客户端

  • xdebug.remote_port:远程端口,默认为9000

  • xdebug.remote_host:远程主机地址

  • xdebug.idekey:控制IDE Xdebug应该传递给dbgp调试器处理程序的密钥

  • xdebug.profiler_enable:是否开启事件查探器

  • xdebug.profiler_output_dir:事件查探器的输出目录

    配置完成后重启server,然后访问phpinfo.php,查看自己的配置,是否存在xdebug,如果查询到xdebug.remote_enable,说明xdebug扩展已经配置安装完成

配置phpstorm

打开phpstorm,快捷键ctl+alt+s,调出配置界面,根据以下截图进行配置

1.jpg

2.jpg

3.jpg

4.jpg

5.png

6.png

7.png

11.jpg

10.jpg