1. 安装xdebug

1
2
sudo pacman -S xdebug
# apt / yum 类似

2. 编辑xdebug.ini文件

1
sudo vim  /etc/php/conf.d/xdebug.ini
1
2
3
4
5
6
7
8
9
zend_extension=xdebug.so
; xdebug 3 的特性
xdebug.mode = debug
xdebug.idekey = PHPSTORM
xdebug.show_error_trace = 1
xdebug.remote_autostart = 0
xdebug.remote_handler = dbgp
xdebug.remote_mode = "req"
xdebug.remote_log=/tmp/xdebug.log

3. 解决Linux下xdebug 更新到3.0 phpstorm debug 不起作用

3.1 原因

  • 由于使用archlinux 环境, xdebug 版本更新到3.0
  • xdebug 将默认的监听口改为了 9003不是9000
    xdebug03

3.2 将debug端口改为9003

xdebug01
xdebug02