使用brew install安裝對應版本的XDebug。使用命令:php
brew search xdebug
對於個人mac來講,要安裝的版本是php7.1的XDebug,故而安裝:web
brew install homebrew/php/php71-xdebugphp7
安裝完畢後執行php -i | grep xdebug查看是否有輸出(有輸出就是安裝上了)debug
xdebug xdebug support => enabled xdebug.auto_trace => Off => Off xdebug.cli_color => 0 => 0 ...
接下來 成功環節code
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.server
Validate installation via one of the following methods:
*homebrew
Using PHP from a webserver:rem
Restart your webserver.get
Write a PHP page that calls "phpinfo();"it
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!
配置環節