🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
因为windows不支持swoole,所以需要在windows配置虚拟linux环境。 (如果能更换操作系统,最好更换成centos) (1)下载安装cygwin(根据操作系统选择32位或者64位):            https://cygwin.com/install.html ![image.png](https://wiki.we7shop.com/uploads/15323780e5601dbb86b7ae918e22a26d.png) 选择在windows中虚拟环境的root目录 ![image.png](https://wiki.we7shop.com/uploads/0e5c6a8c813ede8b086ed31d7d98e244.png)  ![image.png](https://wiki.we7shop.com/uploads/a89782f151bd67e37389c07aeae1d149.png)  选择下载安装的网络节点,如果选择的节点状况不好,可以另选别的节点。 ![image.png](https://wiki.we7shop.com/uploads/4c1f1f9fa953bc0c32ce99155c2196e2.png)  下面选择要安装的包,没有全部选择安装不要点击“下一步” (2)gcc-core ![image.png](https://wiki.we7shop.com/uploads/f8ee5ea2252a497fc10622b3503a4ca9.png)  (3)php、php-devel(两者版本要相同) ![image.png](https://wiki.we7shop.com/uploads/5290af37ce77f0e43c6cfc091e85c26b.png)  (4)autoconf ![image.png](https://wiki.we7shop.com/uploads/9e297aed6cbbc10086b80e46b1b1a0ec.png)  (5)pcre-devel ![image.png](https://wiki.we7shop.com/uploads/660564072eb60014f3c01e761e02635b.png)  (6)make ![image.png](https://wiki.we7shop.com/uploads/6b7cf4a41bf9c653bdbc306ee46fdea9.png)  (7)安装openssl、openssl-devel ![image.png](https://wiki.we7shop.com/uploads/1966fef32307bda0c939be786e8f4fcd.png)  (8)都选择完成后点击下一步会出现安装进程,因为使用网络节点安装,所以可能会有安装中断或者缓慢的情况,关闭重新打开应用换一个节点继续安装就可以。 ![image.png](https://wiki.we7shop.com/uploads/1027899f98800f5bf2b0c049a33da961.png)  选择安装完成后在桌面生成快捷方式。 (9)下载swoole安装包:[https://github.com/swoole/swoole-src/releases](https://github.com/swoole/swoole-src/releases) 并解压到cygwin的安装目录(在步骤1中有选择cygwin的root目录) 解压后如图: ![image.png](https://wiki.we7shop.com/uploads/85adb2f0ebf8c8855d85784a83baf48a.png)  (10)打开cygwin应用  ![image.png](https://wiki.we7shop.com/uploads/ad17ddea980da8954727c57d3f06b671.png) (11)编译安装swoole扩展(swoole解压的文件夹名字视实际情况而定) cd /swoole-src-1.9.14/ phpize ./configure --enable-openssl make make install (12)make install 之后会生成extension的路径(该路径在步骤14中使用) ![image.png](https://wiki.we7shop.com/uploads/202129c3e8ca9e86dd17c63fef34057a.png)  (13)查找php.ini路径: php -i | grep php.ini(该文件路径在步骤14中使用) ![image.png](https://wiki.we7shop.com/uploads/8d223f1d6f05ffb07be155b24aa9dc72.png)  (14)将extension= /usr/lib/php/20151012/swoole.so 添加到/etc/php.ini文件中,保存修改。 (15) php -m 查看是否已经有了swoole扩展,如果有,则说明安装成功。