Skip to content

Commit

Permalink
docs:swoole
Browse files Browse the repository at this point in the history
  • Loading branch information
duiying committed Apr 30, 2019
1 parent a8232ec commit 38b202e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Creating proxy ...
### 学习文档
- [如何新建一个站点](docs/如何新建一个站点.md)
- [如何安装yaf扩展](docs/如何安装yaf扩展.md)
- [如何安装swoole扩展](docs/如何安装swoole扩展.md)

### 可能遇到的问题
```
Expand Down
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 学习文档

- [如何新建一个站点](如何新建一个站点.md)
- [如何安装yaf扩展](如何安装yaf扩展.md)
- [如何安装yaf扩展](如何安装yaf扩展.md)
- [如何安装swoole扩展](如何安装swoole扩展.md)
33 changes: 33 additions & 0 deletions docs/如何安装swoole扩展.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 如何安装swoole扩展

#### 如何安装swoole扩展

```shell
# 进入PHP容器
[root@localhost Docker-LNMP]# docker exec -it cgi bash

# 解决gcc版本过低的问题
yum -y install centos-release-scl
yum -y install devtoolset-7
scl enable devtoolset-7 bash

# 下载、安装
wget https://github.com/swoole/swoole-src/archive/v4.2.1.tar.gz &&\
tar -zxvf v4.2.1.tar.gz &&\
cd swoole-src-4.2.1 &&\
phpize &&\
./configure &&\
make && make install &&\
sed -i '$a \\n[swoole]\nextension=swoole.so' /etc/php.ini &&\
cd ../ && rm -rf v4.2.1.tar.gz swoole-src-4.2.1

# 退出PHP容器
[root@510d01c199f5 /]# exit
exit

# 重启PHP容器
[root@localhost Docker-LNMP]# docker restart cgi
```

![swoole](https://raw.githubusercontent.com/duiying/img/master/swoole.png)

0 comments on commit 38b202e

Please sign in to comment.