Can't install mongo-php-driver on OS X 10.11

心已入冬 提交于 2019-11-29 03:49:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!