- 安装命令:
brew install homebrew/php/php70-xdebug
! ## 安装brew
- 安装成功后会在路径
/usr/local/Cellar/php70-xdebug/2.5.4
- 配置ini
# 命令查看全部ini文件
$ php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/7.0
Loaded Configuration File: /usr/local/etc/php/7.0/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.0/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.0/conf.d/ext-xdebug.ini
# 会发现有两个ini的地方,其中ext-xdebug.ini为插件默认配置的地方
$ cat /usr/local/etc/php/7.0/conf.d/ext-xdebug.ini
[xdebug]
zend_extension="/usr/local/opt/php70-xdebug/xdebug.so"
# 在php.ini中就不用再次指定xdebug的路径了,添加如下命令:
$ vi /usr/local/etc/php/7.0/php.ini
1898 [Xdebug]
1899 ;zend_extension="/usr/local/Cellar/php70-xdebug/2.5.4/xdebug.so"
1900 xdebug.remote_enable = On
1901 xdebug.remote_handler = dbgp
1902 xdebug.remote_host= localhost
1903 xdebug.remote_port = 9000
1904 xdebug.idekey = PHPSTORM
- 命令行运行:
$ php -v
# 仔细查看没有报错信息,证明配置成功
PHP 7.0.19 (cli) (built: May 21 2017 11:56:11) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.4, Copyright (c) 2002-2017, by Derick Rethans
- 然后去phpstorm配置网上一大堆不写了
@ 晴天-2017-06-07 13:01:23