error: failed to write, failed to open stream, pecl install oauth on mac osx el capitan
Asked Answered
K

2

8

I'm trying to install OAuth version 1.2.3 locally with pecl install (running PHP 5.6.10 on Mac OSX El Capitan). Running the following in command prompt:

sudo pecl install oauth-1.2.3

Installation starts fine and runs without errors up until build is done. Then I get this error:

Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20121212/oauth.so'
ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-`20121212/oauth.so 
(copy(/usr/lib/php/extensions/no-debug-non-zts-20121212/oauth.so): 
failed to open stream: Operation not permitted)`

ls shows no oauth.so in folder no-debug-non-zts-20121212, but other than that, folder looks fine.

Things I've tried: - updating pear and pecl - updating MAMP - restarting webserver - restarting computer

Am running out of ideas of things to try. Anyone who's heard of this issue before?

Kero answered 18/1, 2016 at 9:9 Comment(0)
L
13

You need to disable the System Integrity Protection.

  1. Reboot the Mac and hold down Command + R keys simultaneously after you hear the startup chime, this will boot OS X into Recovery Mode.
  2. When the "OS X Utilities" screen appears, pull down the "Utilities" menu at the top of the screen, and choose "Terminal".
  3. Type the following command into the terminal then hit return: csrutil disable

  4. You’ll see a message saying that System Integrity Protection has been disabled and the Mac needs to restart for changes to take effect.

  5. Enter the reboot command, and the Mac will then reboot itself automatically, just let it boot up as normal.

Then try again with sudo pecl install oauth-1.2.3. After the oauth.so is correctly installed in /usr/lib/php/extensions/no-debug-non-zts-20121212/ you should enable the SIP again (after all, this is a feature to protect our system, so it's better to keep it ON).

References consulted:

Lemon answered 9/2, 2016 at 20:52 Comment(0)
W
0

Enabling/Disabling System Integrity Protection is a headache... Instead, follow this link and change your PHP directory path.

http://mrgott.com/misc/10-install-mcrypt-and-intl-php-extensions-on-mac-os-x-and-xampp

Wolfie answered 7/6, 2019 at 13:59 Comment(1)
Can you include the text from the link? that link is deadCornish

© 2022 - 2024 — McMap. All rights reserved.