win7安装Cygwin配置swoole

一、下载Cygwin和swoole

Cygwin 官方地址:http://www.cygwin.com/

swoole 官方下载地址:https://github.com/swoole/swoole-src/

二、安装Cygwin

一直默认下一步,可自行添加163地址,http://mirrors.163.com

win7安装Cygwin配置swoole

(ps:在这一步我卡住了,163链接好像用不了,不过我找到了阿里云的镜像 http://mirrors.aliyun.com/cygwin/

搜索安装如下pachkage,最好安装我指定的版本,别漏(ps:这一步非常重要,我找了很多篇文章最后都失败了,就是因为这一步他们没有讲清楚。在这里非常感谢原著大神助我顺利通关 ^ - ^)

win7安装Cygwin配置swoole

默认下一步,直到安装成功

三、安装swoole

下载的swoole-src-master【已解压】放入cygwin64\home下

进入cygwin命令行:

1、cd /home/swoole-src-master

2、phpize

3、./configure

4、make

5、make install

6、vi /etc/php.ini  插入extension=swoole.so

7、php -m查看是否安装成功

碰见的错误:

1、make的时候出现 In file included from /home/swoole-src/swoole.cc:20:0: /usr/include/php/ext/pcre/php_pcre.h:27:10: 致命错误:pcre2.h:No such file or directory #include "pcre2.h" 

回答:没有按照如图所示的版本安装pachkage

2、checking how to run the C++ preprocessor... /lib/cpp configure: error: in `/home/swoole-src-master': configure: error: C++ preprocessor "/lib/cpp" fails sanity check See `config.log' for more details

回答:安装包目录下,cmd 执行:

C:\cygwin64>setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-devel

重新安装cygwin
————————————————
版权声明:本文为CSDN博主「啦啦啦lir」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/oHeiZhiShi123/article/details/90040826