You need to enable JavaScript to run this app. Mac OS下为PHP 8通过pecl安装xdebug出现mkdir报错如何解决?
优惠活动
大模型
产品
解决方案
定价
更多

Mac OS下为PHP 8通过pecl安装xdebug出现mkdir报错如何解决?

执行phpunit --coverage报错与Xdebug安装失败问题说明
  • 计划执行操作:为项目运行phpunit --coverage命令生成代码覆盖率
  • 首次执行返回报错:
PHPUnit 9.5.0 by Sebastian Bergmann and contributors.

Warning:       No code coverage driver available
  • 排查动作:执行php -v校验当前PHP环境配置,确认是否安装Xdebug扩展,输出结果如下:
PHP 8.0.0 (cli) (built: Nov 30 2020 13:51:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies
  • 排查结论:当前环境未安装Xdebug,因此通过Homebrew执行pecl install xdebug命令安装扩展
  • 安装流程末尾返回报错:
........

Build process completed successfully
Installing '/usr/local/Cellar/php/8.0.0_1/pecl/20200930/xdebug.so'

Warning: mkdir(): File exists in System.php on line 294

Warning: mkdir(): File exists in /usr/local/Cellar/php/8.0.0_1/share/php/pear/System.php on line 294
ERROR: failed to mkdir /usr/local/Cellar/php/8.0.0_1/pecl/20200930

内容的提问来源于stack exchange,提问作者user14577547

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.07 07:06:04