错误:写入失败,无法打开流,pecl 在 mac osx 上安装 oauth [英] error: failed to write, failed to open stream, pecl install oauth on mac osx el capitan

查看:48
本文介绍了错误:写入失败,无法打开流,pecl 在 mac osx 上安装 oauth的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 pecl install(在 Mac OSX El Capitan 上运行 PHP 5.6.10)在本地安装 OAuth 1.2.3 版.在命令提示符下运行以下命令:

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 在文件夹 no-debug-non-zts-20121212 中没有显示 oauth.so,但除此之外,文件夹看起来不错.

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

我尝试过的事情:- 更新梨和 pecl- 更新 MAMP- 重新启动网络服务器- 重启电脑

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?

推荐答案

您需要禁用系统完整性保护.

You need to disable the System Integrity Protection.

  1. 重新启动 Mac 并在听到启动铃声后同时按住 Command + R 键,这会将 OS X 启动到恢复模式.
  2. 当OS X Utilities"屏幕出现时,下拉屏幕顶部的Utilities"菜单,然后选择Terminal".
  3. 在终端中输入以下命令,然后按回车键:csrutil 禁用

  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

您会看到一条消息,指出系统完整性保护已被禁用,Mac 需要重新启动才能使更改生效.

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

输入reboot命令,Mac会自动重启,让它正常启动即可.

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

然后使用 sudo pecl install oauth-1.2.3 重试.oauth.so/usr/lib/php/extensions/no-debug-non-zts-20121212/ 中正确安装后,您应该再次启用 SIP(​​之后总之,这是一个保护我们系统的功能,所以最好保持开启).

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

参考文献:

这篇关于错误:写入失败,无法打开流,pecl 在 mac osx 上安装 oauth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆