mac 安装swoole

源码安装

去 www.swoole.com官网下载源码

然后解压,cd 进去

命令

cd swoole
phpize 
./configure
make 
sudo make install

在mac中注意:在make时会提示 没有php.h文件
  
Mojave没有安装标头。要安装标头:
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

还有在make install 中也会提示没有权限操作
  这是SIP保护机制

禁掉SIP保护机制,步骤是:

重启系统
按住Command + R   (重新亮屏之后就开始按,象征地按几秒再松开,出现苹果标志,ok)
菜单“实用工具” ==>> “终端” ==>> 输入csrutil disable;执行后会输出:Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.
再次重启系统
禁止掉SIP后,就可以顺利的安装了,当然装完了以后你可以重新打开SIP,方法同上,只是命令是csrutil enable

 
 
原文地址:https://www.cnblogs.com/LF-place/p/10885827.html