问题
I've read through all the similar Stack Overflow questions - nothing addresses my specific issue. I'm running OS X 10.11 (El Capitan).
I've cloned the mongo-php-drive repo and these commands succeed:
phpize
./configure
make
But sudo make install
fails:
(master) ~/tmp/mongo-php-driver
$ sudo make install
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20121212/
cp: /usr/lib/php/extensions/no-debug-non-zts-20121212/#INST@39898#: Operation not permitted
make: *** [install-modules] Error 1
I understand that it is a permissions issue but I don't know how to safely fix it. I don't want to loosen the security of something like /usr/*
.
Any suggestions would be much appreciated.
回答1:
The problem was due to OS X 10.11 El Capitan's Rootless feature. To be able to install the extension into /usr/lib/php/*
I had to temporarily disable the feature (instructions - please remember to re-enable it afterwards).
回答2:
press cmd+r when booting up. Then go into utilities > terminal and type the following commands:
csrutil disable
reboot
don't forget to enable it .
来源:https://stackoverflow.com/questions/31879056/cant-install-mongo-php-driver-on-os-x-10-11