问题
Attempting to install PHP, which requires the creation of an extensions directory within /usr/lib/php/extensions
. The installation returned an error "Operation not permitted".
I have since found out, sudo
is not able to create any directories under /usr/
. Anyone else experienced this?
回答1:
Local installations really should be installed under /usr/local, not directly under /usr. Starting in El Capitan, this is enforced by System Integrity Protection. Shouldn't be a big change, just install the extensions in /usr/local/lib/php/extensions, and edit php.ini to set extension_dir
to the appropriate location.
来源:https://stackoverflow.com/questions/33309005/sudo-mkdir-in-usr-operation-not-permitted-el-capitan