一文讲解Ubuntu原生安装Swoole扩展的方法

下面由centos教程栏目给大家介绍ubuntu 原生安装 swoole 扩展的方法,希望对需要的朋友有所帮助!

Ubuntu 原生安装 swoole 扩展

官方编译安装教程 点击(https://wiki.swoole.com/#/environment)

进入 swoole 的 Github 版本列表,选择最新版本的压缩包下载

swoole 版本列表(https://github.com/swoole/swoole-src/releases)

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

下载完成后进行操作

# 如果没有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

如果显示以下代码 正确

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

推荐学习:《centos

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享