
1.使用mac电脑安装php扩展时,有时会出现下面这种问题
cp: /usr/lib/php/extensions/no-debug-non-zts-20131226/#INST@12567#: Operation not permitted
2.错误原因
OSX 10.11 El Capitan(或更高)新添加了一个新的安全机制叫系统完整性保护
System Integrity Protection (SIP),所以对于目录 /System、/sbin、/usr、不
包含(/usr/local/)仅仅供系统使用,其它用户或者程序无法直接使用,而我们的/usr/lib/php/extensions/刚好在受保护范围内
3.禁掉SIP保护机制,解决此问题
1.重启系统
2.按住Command + R
3.当出现苹果图标的时候,执行以下操作:
菜单->实用工具->终端->输入csrutil disable;
4.执行后会输出:
Successfully disabled System Integrity Protection.
Please restart the machine for the changes to take effect.
5.再次重启系统
6.如果启用,步骤如上,命令替换成 csrutil enable
文章来源: MacOS Sierra或者OS X EI Capitan安装PHP扩展出错
人吐槽 | 人点赞 |
发表评论