您能帮我解决以下问题吗?
无法安装,当前用户无法写入 channel “pecl.php.net”的 php_dir
我想安装 php 的 mongodb 扩展
macOS Calelina
Version 10.15.3
gajanan@MyMac / % csrutil status
System Integrity Protection status: disabled.
我已以管理员身份登录
gajanan@MyMac / % php -v
PHP 7.3.11 (cli) (built: Dec 13 2019 19:21:21) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
gajanan@MyMac / % pecl version
PEAR Version: 1.10.10
PHP Version: 7.3.11
Zend Engine Version: 3.3.11
Running on: Darwin MyMac.local 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
gajanan@MyMac / % sudo pecl install mongodb
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user
gajanan@MyMac / % sudo pecl channel-update pecl.php.net
Updating channel "pecl.php.net"
Registry directory is not writeable by the current user
谢谢
最佳答案
我必须更改本地目录的路径才能解决此问题。 这是检查配置的示例
pecl config-show
下面是设置变量路径的示例:
pecl config-set php_dir </usr/local/path>
关于php - 无法安装,当前用户无法写入 channel "pecl.php.net"的 php_dir,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60588707/