Swoole 学习笔记 安装

win10 开启 liunx 子系统 安装 swoole

使用BashOnWindows为Ubuntu

修改apt-get源文件(/etc/apt/sources.list)

  1. 备份
	cd /etc/apt/
	sudo cp sources.list sources.list.bak
  1. 获取版本号并修改sources.list(我的版本号为bionic)
	//	获取版本号:bionic
	lsb_release -c 
	Codename:       bionic
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  1. 更新
	sudo apt-get update

安装swoole

	apt-get install php7.2 php7.2-curl php7.2-gd php7.2-gmp php7.2-json php7.2-mysql php7.2-opcache php7.2-readline php7.2-sqlite3 php7.2-tidy php7.2-xml  php7.2-bcmath php7.2-bz2 php7.2-intl php7.2-mbstring  php7.2-mcrypt php7.2-soap php7.2-xsl  php7.2-zip
	pecl install swoole
	echo 'extension=swoole.so' >> /etc/php/7.2/mods-available/swoole.ini
	cd /etc/php/7.2/cli/conf.d/ && ln -s ../../mods-available/swoole.ini 20-swoole.ini

检查swoole是否安装完成

php --ri swoole

Liunx(Centos) 编译安装 Swoole

更新yum

yum update

下载并解压安装swoole

wget https://github.com/swoole/swoole-src/archive/v4.4.16.tar.gz
tar -zxf v4.4.16.tar.gz
cd swoole-src-4.4.16/
phpize
./configure //	编译
maek install	//	安装

修改php.ini配置

//	PS : 可以使用 php --ini 来定位到 php.ini 的绝对路径
vim /www/server/php/72/etc/php.ini 
//	添加扩展
extension=swoole.so
//	查看是否安装完成
php -m
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值