mac 安装 swoole 可能会出现的错误
请先看完之后再操作
一、用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 可能会出现的错误的更多相关文章
- ubuntu 安装 swoole 和mac 安装swoole 扩展
ubuntu php 安装swoole 比较容易 1. 从git下载源码 2. 下载pcre http://sourceforge.net/projects/pcre/files/pcre/8.36/ ...
- Mac安装swoole中遇到的问题
转:https://blog.csdn.net/lishanleilixin/article/details/96137272 1:下载swoole源码,https://github.com/swoo ...
- "virtualbox for mac安装器遇到了一个错误, 导致安装失败. 请联系软件制造商以获得帮助"的解决办法
virtualbox下载地址: https://www.virtualbox.org/wiki/Downloads 原因:"Mac OS 10.13.4 会阻止外部内核扩展的安装" ...
- 安装swoole出现make报错的原因与解决方法
安装swoole报错,错误信息如下: 报错原因 报错很明显,找不到 openssl/ssl.h ,首先要确认电脑上有没有安装 openssl Mac安装openssl 既然它找不到,那么就需要手动的指 ...
- VMware11安装Mac OS X10提示不可恢复错误解决
VMware11安装Mac OS X10提示不可恢复错误(vcpu-0)怎么办?本文将详细介绍如何解决VMware11安装Mac OS X10提示不可恢复错误. 工具/原料 VMware11 PC ...
- 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 ...
- mac用pecl安装swoole可能出现的报错及解决办法
一.用pecl安装swoole 2018年4月,由于homebrew的变动,导致无法使用brew install的方式安装php的扩展,现在改为用pecl安装,pecl安装swoole的方法为: pe ...
- Mac系统下 PHP7安装Swoole扩展 教程
转载自 https://www.fujieace.com/php/php-extensions/swoole.html 今天我用的PHP版本是:PHP7.1 环境依赖: php-5.3.10 或更高版 ...
- 安装node-sass时出现的错误解决方案(Mac自用,也可以借鉴)
安装node-sass时出现一下错误: gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir ...
随机推荐
- python_ 学习笔记(基础语法)
python的注释 使用(#)对单行注释 使用('''或者""")多行注释,下面的代码肯定了python的牛逼 print("python是世界上最好的语言吗? ...
- js之标签操作
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- poj 3074
题意:解数独 分析: 完整的数独有四个充要条件: 1.每个格子都有填数字 2.每列都有1~9中的每个数字 3.每行都有1~9中的每个数字 4.每个9宫格都有1~9中的每个数字 可以转化成精确覆盖问题. ...
- 我不喜欢的 Rust 特性 (之一) eager drop
struct Foo; impl Drop for Foo { fn drop(&mut self) { println!("drop"); } } fn main() { ...
- Calculate S(n)
Problem Description Calculate S(n). S(n)=13+23 +33 +......+n3 . Input Each line will contain one i ...
- POJ 1328 Radar Installation 贪心算法
Description Assume the coasting is an infinite straight line. Land is in one side of coasting, sea i ...
- Ubuntu 16.04使用NASM编译时用ld链接程序出现:i386 架构于输入文件 sandbox.o 与 i386:x86-64 输出不兼容(I386 architecture in the input file sandbox.o is not compatible with i386: x86-64 output)
错误: 问题解决过程: 1.先确定CPU的架构 2.这是以64位架构的CPU,如果使用elf参数时,默认是以32位模式去处理,那么此时需要更精确的去指定这个模式,比如elf32(32位),elf64( ...
- linux程序设计——运行SQL语句(第八章)
8.3 使用C语言訪问MySQL数据 8.3.3 运行SQL语句 运行SQL语句的主要API函数被恰当的命名为: int mysql_query(MYSQL *connection, const ...
- SpringBoot在Impl类中调用其它service层失败解决办法
在AImpl.java文件中引用BImpl.java的方法,编译正常,运行到调用的地方,报空指针异常,跟踪到异常位置,发现service为空,也就是按照之前controller层通过@Autowire ...
- node.js下操作cookie
cookie,又是cookie.工作中与cookie打交道很多次,不过时间跨度也大,每总结多一次,就加深了解多一点. cookie,一定是放在浏览器中的,用于浏览器保存一些小额度的内容.每次我们去访问 ...