我正在Macos High Sierra 10.13.6上构建Web开发IDE,并遵循此tutorial。我现在需要安装PHP扩展(特别是xDebug),但是这是我每次添加任何扩展时都会遇到的错误:checking whether the C compiler works... no
整个日志:
pecl install xdebug
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading xdebug-2.7.0.tgz ...
Starting to download xdebug-2.7.0.tgz (230,326 bytes)
.................................................done: 230,326 bytes
69 source files, building
running: phpize
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
building in /private/tmp/pear/temp/pear-build-fredericsBTF0Y/xdebug-2.7.0
running: /private/tmp/pear/temp/xdebug/configure --with-php-config=/Applications/MAMP/bin/php/php7.0.15/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking whether the C compiler works... no
configure: error: in `/private/tmp/pear/temp/pear-build-fredericsBTF0Y/xdebug-2.7.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: `/private/tmp/pear/temp/xdebug/configure --with-php-config=/Applications/MAMP/bin/php/php7.0.15/bin/php-config' failed
我到处阅读以检查命令行工具是否已安装,确实如此(我什至删除了它们并重新安装了它们)。现在我有了Xcode版本10.1和:xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Gcc在pecl之外工作:
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
which gcc
/usr/bin/gcc
但是,这有点奇怪:Clang安装目录在我的python Conda Manager中!!
clang --version
clang version 4.0.1 (tags/RELEASE_401/final)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Users/frederic/miniconda3/bin
which clang
/Users/frederic/miniconda3/bin/clang
尽管如此,当我通过Xcode进行检查时:
xcodebuild -find gcc
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
xcodebuild -find clang
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
miniconda会给自己的叮当造成麻烦吗?或者是别的什么 ? 谢谢