使用brew install安装对应版本的XDebug。使用命令:
brew search xdebug
对于我的mac来说,要安装的版本是php7.1的XDebug,故而安装:brew install homebrew/php/php71-xdebug
安装完毕后执行php -i | grep xdebug查看是否有输出(有输出就是安装上了)
xdebugxdebug support => enabledxdebug.auto_trace => Off => Offxdebug.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!
配置环节