无法安装 PEAR

JAs*_*cio 4 php pear osx-elcapitan

sudo php -d detect_unicode=0 go-pear.phar
Run Code Online (Sandbox Code Playgroud)

无法创建 PHP 代码目录 ($php_dir) /usr/share/pear。

我需要更改 /usr/share 的权限吗?当前权限是 drwxr-xr-x

小智 5

/usr 文件夹受到保护。您可以禁用 SIP,但这不是最佳选择。

可以为“安装库”选择1,并将目录更改为/usr/local

然后它将应用于所有其他地址。

看看这个其他问题 https://apple.stackexchange.com/questions/237778/cant-write-to-usr-even-with-sudo