Nie można pisać do / usr nawet w sudo


10

Oto mój problem:

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

... powinienem pozwolić mi działać jako root, modyfikować /usri /usr/sharekatalogi, ale otrzymuję to:

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.

Dlaczego sudonie daje mi uprawnień roota? * Uwaga: * Należę do grupy kierowców, choć to nie powinno mieć nic z tym zabawnym sudozachowaniem.

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

Odpowiedzi:


15

Próbujesz zainstalować, w /usrktórym jest chroniony przez SIP (System Integrity Protection), funkcję wprowadzoną w wersji 10.11 ( szczegółowe informacje na temat funkcji „rootless” w El Capitan? ).

/usr/localZamiast tego użyj , która jest miejscem przeznaczonym do instalacji po stronie użytkownika.


tak, z wyjątkiem tego, że muszę link do / usr / include lub nie mogę skompilować z gcc 4.9!
Michael

Myślę, że musisz wyłączyć SIP.
jasonology

Stara odpowiedź, ale dlaczego nie możesz po prostu powiedzieć GCC, gdzie znaleźć pliki dołączane? Do tego służy opcja „-l”. PHP jako root ... <dreszcz>
Marc Wilson
Korzystając z naszej strony potwierdzasz, że przeczytałeś(-aś) i rozumiesz nasze zasady używania plików cookie i zasady ochrony prywatności.
Licensed under cc by-sa 3.0 with attribution required.