Home  >  Article  >  Operation and Maintenance  >  An article explaining how to natively install Swoole extensions on Ubuntu

An article explaining how to natively install Swoole extensions on Ubuntu

藏色散人
藏色散人forward
2021-10-29 14:57:492604browse

The following tutorial column of centos will introduce to you how to install the Swoole extension natively in Ubuntu. I hope it will be helpful to friends in need!

Ubuntu native installation of Swoole extension

Official compilation and installation tutorial click (https://wiki.swoole.com/#/environment)

to enter Github version list of swoole, select the latest version of the compressed package to download

swoole version list (https://github.com/swoole/swoole-src/releases)

$ wget https://github.com/swoole/swoole-src/archive/refs/tags/v4.8.0.zip

After the download is complete Operation

# 如果没有unzip 的话
$ apt-get unzip
#之后解压下载的压缩包
$ unzip v4.8.0.zip
# 进入目录
$ cd v4.8.0.zip
# 编译
$ phpize
# ubuntu 没有安装 phpize 可执行命令下面的这个来安装 phpize
$ sudo apt-get install php-dev 
# 编译配置检测
$ ./configure --enable-openssl --enable-http2 --enable-swoole-curl --enable-swoole-json
# 编译
$ make
# 安装
$ make install
#查看扩展
$ php --ri swoole

If the following code is displayed correctly

Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.8.0
Built => Oct 15 2021 09:34:32
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 1.1.1f  31 Mar 2020
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
zlib => 1.2.11
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608

Recommended learning: "centos tutorial"

The above is the detailed content of An article explaining how to natively install Swoole extensions on Ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete