Windows
php.ini
配置
[XDebug]
; 插件位置,绝对路径
zend_extension="D:\phpStudy\php\php-5.6.27-nts\ext\php_xdebug.dll"
; 开启远程调试
xdebug.remote_enable=1
; 没有带 XDEBUG_SESSION_START 参数也会尝试进入调试模式
xdebug.remote_autostart=1
; 忽略 xdebug.remote_host 的设置,返回发出请求的 IDE 的 IP
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_mode=req
xdebug.idekey='PHPSTORM'
Docker
安装 xdebug 插件,构建镜像
FROM php:7-fpm
RUN apt-get update \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug
通过 Volume 配置 php.ini
[XDebug]
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_mode=req
xdebug.idekey='PHPSTORM'
PhpStorm
配置


Chrome
浏览器配置




Postman
配置
需要调试的地址带上XDEBUG_SESSION_START
参数即可
www.xxx.com?XDEBUG_SESSION_START=PHPSTORM
网友评论