尝试安装redis 跟 xdebug都出现同样的报错,初步确定不是版本的问题。
执行pecl install xdebug 运行后报错
比较关键的报错点,
checking whether the C compiler works... no
configure: error: in `/private/tmp/pear/temp/pear-build-rootl42moi/xdebug-3.1.2':
configure: error: C compiler cannot create executables
通过不断的查阅文档,找到一篇类似的文档
macos - OS X Yosemite Configure: checking whether the C compiler works... no - Stack Overflow
macos - OS X 10.9.2: checking whether the C compiler works... no - Stack Overflow
猜测是gcc的问题,重新安装一下gcc结果又报错
那就安装一下xcode,运行命令
xcode-select --install
完成再次安装php扩展
pecl install xdebug
成功。
安装redis 失败并不在于安装的什么而且要看报错信息