请先看完之后再操作

一、用pecl安装swoole(没有安装起来)

2018年4月,由于homebrew的变动,导致无法使用brew install的方式安装php的扩展,现在改为用pecl安装,pecl安装swoole的方法为:

pecl install swoole

出现在选项要填yes还是no,这篇文章有写:https://www.jianshu.com/p/14f542b7e5d0#comment-27164461

可能出现的报错及解决方法

  • 1 fatal error: ‘openssl/ssl.h‘ file not found
解决方法1:cp -R /usr/local/opt/openssl/include/openssl /usr/local/include

解决方法2:ln -s /usr/local/opt/openssl/include/openssl /usr/local/include/openssl

原因:一般用brew安装的软件,都会把需要include的文件自动放到/usr/local/include里的,但是不知为什么安装openssl的时候没有放到那里,所以要自己拷过去,其实最好的方法是做一个链接,即用解决方法2!
  • 2 error: Cannot find libpq-fe.h. Please confirm the libpq or specify correct PostgreSQL(libpq) installation path
解决方法 brew reinstall PostgreSQL

原因:可能是没有安装PostgreSQL
  • 3 fatal error: ‘hiredis/hiredis.h‘ file not found
出现这个原因绝大多数是因为没有安装hiredis,用brew search hiredis看看有没安装,没有安装直接用brew install hiredis安装后,再次pecl install swoole就可以

细心的童鞋会发现,brew install hiredis后,/usr/local/include里,多了一个hiredis,而且这个是一个软链,链接到/usr/local/Cellar/hiredis/0.13.3/include/hiredis
  • 结果还是报错,没有搞定,能力有限.

二、换了个方式 安装swoole(完美解决)

  • 2.1 下载swoole
sudo pecl download swoole
  • 2.2 编译安装
tar zxvf swoole-4.2.12.tgz    // 注意自己下载的版本,可能不一定
cd swoole-4.2.12
phpize
./configure --enable-openssl --enable-http2 --enable-sockets --enable-mysqlnd -with-openssl-dir=/usr/local/Cellar/openssl/1.0.2s/
make clean && make && sudo make install
  • 2.3 遇到报错
mkdir: /usr/local/Cellar/php@7.1/7.1.30/pecl: File exists
mkdir: /usr/local/Cellar/php@7.1/7.1.30/pecl: No such file or directory
make: *** [install-modules] Error 1 // 大致意思就是 pecl 文件夹存在,但是打不开
// 我的pecl是软连接过来的 不知道为什么打不开
  • 2.4 解决方法
修改 /usr/local/Cellar/php@7.1/7.1.30/bin/php-config 

extension_dir=‘/usr/local/Cellar/php@7.1/7.1.30/pecl/20160303‘ 中的 『pecl』 换成 『lib/php』
extension_dir=‘/usr/local/Cellar/php@7.1/7.1.30/lib/php/20160303‘
  • 2.5 重新编译
./configure --enable-openssl --enable-http2 --enable-sockets --enable-mysqlnd -with-openssl-dir=/usr/local/Cellar/openssl/1.0.2s/
make clean && make && sudo make install
  • 2.6 添加 swoole.so
修改php.ini 在文件末尾 加一行
extension = "/usr/local/Cellar/php@7.1/7.1.30/lib/php/20160303/swoole.so"
  • mac安装swoole 真是疼

mac 安装 swoole 可能会出现的错误的更多相关文章

  1. ubuntu 安装 swoole 和mac 安装swoole 扩展

    ubuntu php 安装swoole 比较容易 1. 从git下载源码 2. 下载pcre http://sourceforge.net/projects/pcre/files/pcre/8.36/ ...

  2. Mac安装swoole中遇到的问题

    转:https://blog.csdn.net/lishanleilixin/article/details/96137272 1:下载swoole源码,https://github.com/swoo ...

  3. "virtualbox for mac安装器遇到了一个错误, 导致安装失败. 请联系软件制造商以获得帮助"的解决办法

    virtualbox下载地址: https://www.virtualbox.org/wiki/Downloads 原因:"Mac OS 10.13.4 会阻止外部内核扩展的安装" ...

  4. 安装swoole出现make报错的原因与解决方法

    安装swoole报错,错误信息如下: 报错原因 报错很明显,找不到 openssl/ssl.h ,首先要确认电脑上有没有安装 openssl Mac安装openssl 既然它找不到,那么就需要手动的指 ...

  5. VMware11安装Mac OS X10提示不可恢复错误解决

    VMware11安装Mac OS X10提示不可恢复错误(vcpu-0)怎么办?本文将详细介绍如何解决VMware11安装Mac OS X10提示不可恢复错误. 工具/原料   VMware11 PC ...

  6. Mac os 安装 alipay-sdk-python 3.3.92错误 line 278,其实是另一个依赖包pycrypto安装有问题。

    日期2019.7.17解决的问题. 系统mac os 10.14.5 python 3.6 django 1.11 要安装alipay-sdk-python 3.3.92错误 line 278, in ...

  7. mac用pecl安装swoole可能出现的报错及解决办法

    一.用pecl安装swoole 2018年4月,由于homebrew的变动,导致无法使用brew install的方式安装php的扩展,现在改为用pecl安装,pecl安装swoole的方法为: pe ...

  8. Mac系统下 PHP7安装Swoole扩展 教程

    转载自 https://www.fujieace.com/php/php-extensions/swoole.html 今天我用的PHP版本是:PHP7.1 环境依赖: php-5.3.10 或更高版 ...

  9. 安装node-sass时出现的错误解决方案(Mac自用,也可以借鉴)

    安装node-sass时出现一下错误: gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir ...

随机推荐

  1. zabbix部署-版本3.2.6

    172.18.237.14:一台主机上安装LAMP环境以及zabbix_server.zabbix_agentd 一.安装zibbix-server 1.环境要求 yum install mysql- ...

  2. centOS目录结构介绍

    Linux / CentOS目录结构 /: 根目录,一般根目录下只存放目录,不要存放文件,/etc./bin./dev./lib./sbin应该和根目录放置在一个分区中 /bin:/usr/bin: ...

  3. Mysql Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode

    今天用mysql workbench在更新数据的时候,出现了下面错误:15:52:39    update wp_posts set post_content = replace(post_conte ...

  4. lastpass密码管理工具使用教程

    现在移动互联网发展异常空气,无论访问哪个平台或者网站必须要注册账号,日子久了就会发现最痛苦的就是记住这些网站的密码.因为我们不可能将所有的网站都是设置同样的的账号密码,因为国内网站用户数据库被泄露的事 ...

  5. 1.Ubuntu查看Python版本

    1.输入命令:ls -l /usr/bin/python*

  6. RequestMapping_请求参数&请求头

    params和headers支持简单的表达式: --param1:表示请求必须包含名为param1的请求参数. --!param1:表示请求不能包含名为param1的请求参数. --param1 != ...

  7. Netty学习总结(4)——图解Netty之Pipeline、channel、Context之间的数据流向

    以下所绘制图形均基于Netty4.0.28版本. 一.connect(outbound类型事件) 当用户调用channel的connect时,会发起一个outbound类型的事件,该事件将在pipel ...

  8. 49. spring boot日志升级篇—理论【从零开始学Spring Boot】

    我们之前在其中的一篇文章介绍过如何在spring boot中使用日志记录SLF4J. Spring Boot在所有内部日志中使用Commons Logging,但是默认配置也提供了对常用日志的支持,如 ...

  9. Codeforces Round #240 (Div. 2) C Mashmokh and Numbers

    , a2, ..., an such that his boss will score exactly k points. Also Mashmokh can't memorize too huge ...

  10. 洛谷——P2910 [USACO08OPEN]寻宝之路Clear And Present Danger

    P2910 [USACO08OPEN]寻宝之路Clear And Present Danger 题目描述 Farmer John is on a boat seeking fabled treasur ...