Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sudo mkdir in /usr/, Operation not permitted. El Capitan [closed]

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?

like image 877
THEK Avatar asked Oct 23 '15 18:10

THEK


1 Answers

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.

like image 117
Gordon Davisson Avatar answered Nov 08 '22 05:11

Gordon Davisson