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

2

6

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.

Paralyze answered 7/8, 2015 at 13:33 Comment(5)
When you used git clone did you then switch to a stable branch/tag? If not then you are reading off "master" which is certainly unstable. Use git checkout to switch to a version which is supported.Phytosociology
After cloning, I run ``git branch -v``` and the result is * master 071165f Merge branch 'v1.6'. I'm new to git - doesn't this mean I'm on the latest stable branch (which seems to be be v1.6). How do I switch to the right branch? (thank you for your help!)Paralyze
Read up on git, and look on github for the latest release tags ( most likely ) for details on what to switch to. Many questions on here about how to do git checkout for tags.Phytosociology
I checked out and built v1.6.10 (the latest stable tag) and the results are exactly the same - it can't install to /usr/lib/php/extensions/ due to a permission problem. Again, I'd like to know the right/safe way to change the directory permissions so that make install can succeed.Paralyze
I've successfully re-enabled mcrypt by using the technique found at the following link (placing the extension in un-SIP-protected /usr/local). I'd be curious if it also works with mongo (I don't see why it wouldn't). https://mcmap.net/q/1630760/-error-in-mcrypt-after-upgrading-into-el-capitan-osBenz
P
20

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

Paralyze answered 7/8, 2015 at 18:11 Comment(0)
L
6

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 .

Landis answered 23/6, 2016 at 12:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.