Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 217
RobertJoseph Avatar asked Aug 07 '15 13:08

RobertJoseph


2 Answers

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).

like image 126
RobertJoseph Avatar answered Oct 06 '22 14:10

RobertJoseph


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 .

like image 6
Mohammad Mahdi KouchakYazdi Avatar answered Oct 06 '22 13:10

Mohammad Mahdi KouchakYazdi