1、安装xdebug:
pecl install xdebug
2、配置php.ini:
[xdebug]
zend_extension="xdebug.so"
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
xdebug.start_upon_error=yes
3、配置phpstorm:
PHP->Debug->Xdebug->Debug port : 9003
PHP->CLI Interpreter:
4、重启PHP
详情查看官方文档:https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html#downloadAndInstall