使用brew install安装对应版本的XDebug。使用命令:
brew search xdebug
对于我的mac来说,要安装的版本是php7.1的XDebug,故而安装:
brew install homebrew/php/php71-xdebug
安装完毕后执行php -i | grep xdebug查看是否有输出(有输出就是安装上了)
xdebug
xdebug support => enabled
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
...
接下来 成功环节
To finish installing xdebug for PHP 7.1:
/usr/local/etc/php/7.1/conf.d/ext-xdebug.ini was created,
do not forget to remove it upon extension removal.Validate installation via one of the following methods:
*Using PHP from a webserver:
Restart your webserver.
Write a PHP page that calls "phpinfo();"
Load it in a browser and look for the info on the xdebug module.
If you see it, you have been successful!
*
Using PHP from the command line:
Run
php -i "(command-line 'phpinfo()')"
Look for the info on the xdebug module.
-
If you see it, you have been successful!
配置环节
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。