php 在Mac上通过pecl安装Xdebug时出错-无法创建临时目录

zvokhttg  于 2022-12-10  发布在  PHP
关注(0)|答案(1)|浏览(257)

在Mac Monterey上,当尝试通过pecl安装xdebug时,我收到以下错误:

downloading xdebug-3.2.0.tgz ...
Starting to download xdebug-3.2.0.tgz (245,775 bytes)
....................................................done: 245,775 bytes

Notice: tempnam(): file created in the system's temporary directory in System.php on line 420
PHP Notice:  tempnam(): file created in the system's temporary directory in /usr/local/Cellar/php/8.1.13/share/php/pear/System.php on line 420

Notice: tempnam(): file created in the system's temporary directory in /usr/local/Cellar/php/8.1.13/share/php/pear/System.php on line 420

Notice: tempnam(): file created in the system's temporary directory in System.php on line 420
PHP Notice:  tempnam(): file created in the system's temporary directory in /usr/local/Cellar/php/8.1.13/share/php/pear/System.php on line 420

Notice: tempnam(): file created in the system's temporary directory in /usr/local/Cellar/php/8.1.13/share/php/pear/System.php on line 420
ERROR: failed to mkdir /private/tmp/pear/temp/xdebug/m4

我试过在/private/tmp中更改chmod的权限,但没有任何区别。我已经验证了XCode命令行工具已经安装并且是最新的,我已经完全卸载了-包括卸载后手动删除目录-并通过Homebrew重新安装PHP(当前版本为v8.1.13),但我仍然无法克服这个错误。
要通过pecl安装Xdebug,我需要做些什么?

wgeznvg7

wgeznvg71#

通过在PECL中设置temp_dir配置设置,您应该能够将临时路径设置为已知具有完全写访问权限的路径:

pecl config-set temp_dir /home/<youruser>/tmp`

然后确保该目录存在。

相关问题