发布日期

PhpStorm + Xdebug

php版本 : 7.4 (必须使用pecl 安装 xdebug 扩展)

phpstorm 版本 : 2021.2.1(注:IDE port 必须和 xdebug.client_port = 9001 一致)

php.ini 新增以下配置(对应xdebug版本)

xdebug 2.0
zend_extension="xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port = 9001
xdebug.idekey = PHPSTROM
xdebug.remote_host=localhost
xdebug.remote_autostart = 1
xdebug 3.0及以上
zend_extension="xdebug.so"
xdebug.start_with_request=yes
xdebug.discover_client_host=true
xdebug.remote_cookie_expire_time = 3600
xdebug.client_host=localhost
xdebug.client_port = 9001
xdebug.remote_handler = dbgp
xdebug.idekey=PHPSTORM
xdebug.mode = debug