即使使用sudo也无法写入/ usr


10

这是我的问题:

sudo php -d detect_unicode=0 go-pear.phar

...应该让我以root身份运行并修改/usr/usr/share目录,但是我得到了:

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : /usr
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/bin
 5. PHP code directory ($php_dir)                 : /usr/share/pear
 6. Documentation directory                       : /usr/docs
 7. Data directory                                : /usr/data
 8. User-modifiable configuration files directory : /usr/cfg
 9. Public Web Files directory                    : /usr/www
10. System manual pages directory                 : /usr/man
11. Tests directory                               : /usr/tests
12. Name of configuration file                    : /private/etc/pear.conf

1-12, 'all' or Enter to continue: 
Unable to create PHP code directory ($php_dir) /usr/share/pear.
Run this script as root or pick another location.

为什么sudo不能给我root特权?*注意:*我属于转轮组,尽管这种有趣的sudo举动不应该有任何东西。

Gabbar-Singh:~ anadi$ id anadi
uid=XXX(anadi) gid=XX(staff) groups=XX(staff),0(wheel)

Answers:


15

您正在尝试安装/usrSIP(系统完整性保护)保护的系统,SIP是10.11附带的功能(有关详细信息请参阅 El Capitan中的“无根”功能是什么?)。

/usr/local改用,这是供用户端安装使用的位置。


是的,除了我需要链接到/ usr / include否则我无法使用gcc 4.9进行编译!
迈克尔”

我想您必须禁用SIP。
jasonology

旧的回应,但为什么不告诉GCC在哪里可以找到包含文件?这就是'-l'选项的作用。以PHP为根... <shudder>
Marc Wilson
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.