windows下载安装swoole的方法
windows下载安装swoole的方法
先安装Cygwin 选择163镜像(速度非常快) add url http://mirrors.163.com/cygwin/ 然后安装gcc php pcre-devel autoconf模块 如图下
选择安装的软件包,这里需要安装gcc、php、php开发工具、autoconf、pcre-devel,其它默认,这里注意的是,在上方的搜索栏搜索后,在下边找到对应的软件包选中,点击下一步按钮开始安装。(注意:下方的截图是我安装后界面,点击的位置一样,后边的图标可能不一样哦)
先在搜索gcc
<img src="https://img-blog.csdn.net/20151119131721446?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
然后php 这里注意PHP里面的模块json勾上
<img src="https://img-blog.csdn.net/20151119131819962?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
在就是pcre-devel
<img src="https://img-blog.csdn.net/20151119131914582?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
最后autoconf
<img src="https://img-blog.csdn.net/20151119132004957?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
最后一直下一步安装就行。
<img src="https://img-blog.csdn.net/20151119132124642?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
2 安装swoole
ps:swoole版本必须要是2.x版本 下载地址https://github.com/swoole/swoole-src/releases/tag/v2.2.0 不然安装会报错缺少c++库
此时的环境就好似linux的终端,而根目录就是Cygwin的安装目录,在界面输入命令:cd /home/swoole-src,其中swool-src是解压的源程序
<div>此时的环境就好似linux的终端,而根目录就是Cygwin的安装目录,在界面输入命令:cd /home/swoole-src,其中swool-src是解压的源程序</div>
<div><img src="https://img-blog.csdn.net/20151119133047435?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></div>
<div></div>
<div>输入命令:phpize,生成编译的配置文件configure</div>
<div><img src="https://img-blog.csdn.net/20151119133310166?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></div>
<div>输入命令:./configure && make && make install</div>
<div><img src="https://img-blog.csdn.net/20151119133514269?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></div>
<div>
配置、编译、编译安装swoole
(PS:执行./configure,除了编译配置,还会检测环境等等)
使用命令: php -i | grep php.ini,找到php cli使用的配置文件php.ini的路径,修改php.ini文件,在文件中添加一行:extension=swoole.so,然后关闭退出
<img src="https://img-blog.csdn.net/20151119134502744?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
/extension 查找 按n再次查找
<img src="https://img-blog.csdn.net/20151119134544253?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
添加extension=swoole.so
<img src="https://img-blog.csdn.net/20151119134731923?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
:wq 保存退出
使用命令:php -m,查看加载的模块,如果看到swoole,则扩展添加成功,到此环境搭建成功!
<img src="https://img-blog.csdn.net/20151119135103296?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
</div>
如果遇到什么不懂的地方直接关注公众号留言(本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。)
作者:newmiracle
出处:https://www.cnblogs.com/newmiracle/