1,下载安装php-xdebug
cd xdebug-2.5.1/
phpize
./configure
make && make install
2,配置php.ini 文件
[xdebug]
zend_extension = /usr/local/Cellar/php@5.6/5.6.37/pecl/20131226/xdebug.so
xdebug.remote_enable = on
xdebug.remote_autostart = 1
xdebug.remote_handler = dbgp
xdebug.idekey = "PHPSTORM"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9001
xdebug.auto_trace=1
3,重启自己的php-fpm 如果brew安装的brew services start php5.6命令重启 或者 sudo killall php-fpm && sudo php-fpm
版本选择2.5.3成功
4,phpstorm配置
php.ini 中的配置xdebug.idekey,xdebug.remote_host,xdebug.remote_port
大功告成,教程比较简介,但是完成基本没啥问题,需要注意的地方都给大家标出来了,如果还是有不太明白童鞋可以留言给我
5:如果你想使用postman进行调试,也很简单添加如下headers:
Cookie:XDEBUG_SESSION=PHPSTORM
_SERVER["HTTP_COOKIE"] | pgv_pvi=184848384; XDEBUG_SESSION=PHPSTORM |
xdebug.idekey | PHPSTORM | PHPSTORM |