侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

centos7下载安装包编译安装Swoole步骤流程

swoole  /  管理员 发布于 3年前   1053

centos7下载安装包编译安装Swoole步骤流程


我的系统是centos7.4 ,php版本是7.3

所以我直接上swoole官网下载最新的包:swoole-4.5.2.tgz 

swoole官网:http://pecl.php.net/package/swoole


我的服务器在阿里云上所以直接用winscp工具上传至服务器

[root@iz8vbcrus31oj2axurgpjyz ~]# ll
total 5912
drwxr-xr-x  7 root  root     4096 Jun 19  2019 lnmp1.6
-rw-r--r--  1 root  root   161833 Mar 14 22:44 lnmp1.6.tar.gz
-rw-r--r--  1 root  root  3623731 Mar 21 18:31 lnmp-install.log
-rw-r--r--  1   501 games  194763 May 31 17:01 package.xml
drwxr-xr-x  2 mysql mysql    4096 Oct 23  2019 rar
-rw-r--r--  1 root  root   551239 Nov  8  2019 rarlinux-x64-5.8.b3.tar.gz
drwxr-xr-x 14 root  root     4096 Jun 17 12:37 swoole-4.5.2
-rw-r--r--  1 root  root  1496045 Jun 17 11:21 swoole-4.5.2.tgz

开始安装

1.解压

tar -zxvf swoole-4.5.2.tgz

2.准备扩展安装编译环境 (注:进入swoole-4.5.2目录执行下面命令)

cd /swoole-4.5.2
phpize

3.查看php-config位置

[root@iz8vbcrus31oj2axurgpjyz ~]# find / -name php-config
/usr/local/php/bin/php-config

4.配置:(--with-php-config==后面是你自己的php-config位置)在3步骤的路径

./configure --with-php-config=/usr/local/php/bin/php-config

5.编译安装

make && make install

creating swoole.la
(cd .libs && rm -f swoole.la && ln -s ../swoole.la swoole.la)
/bin/sh /root/swoole-4.5.2/libtool --mode=install cp ./swoole.la /root/swoole-4.5.2/modules
cp ./.libs/swoole.so /root/swoole-4.5.2/modules/swoole.so
cp ./.libs/swoole.lai /root/swoole-4.5.2/modules/swoole.la
PATH="$PATH:/sbin" ldconfig -n /root/swoole-4.5.2/modules
----------------------------------------------------------------------
Libraries have been installed in:
  /root/swoole-4.5.2/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
  - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
    during execution
  - add LIBDIR to the `LD_RUN_PATH' environment variable
    during linking
  - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
  - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20180731/
Installing header files:          /usr/local/php/include/php/
[root@iz8vbcrus31oj2axurgpjyz swoole-4.5.2]#

6.在php.ini里面加一行 (我的在/usr/local/php/etc下面)

extension = swoole.so

7.重启一下php服务 (我是安装的lnmp环境所以直接 lnmp restart重启了)


安装完了

1.使用 php -m 命令查看swoole扩展是否安装成功

2.或直接查看phpinfo信息

1.png



  • 上一条:
    php中5中常用优化写法对比
    下一条:
    mysql数据处理之replace用法详解,加一个线上项目案例分享
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • php中使用hyperf框架调用讯飞星火大模型实现国内版chatgpt功能示例(1个评论)
    • php中使用hyperf框架调用文心千帆大模型实现国内版chatgpt功能示例(0个评论)
    • 在hyperf框架中使用基于protobuf的RPC生成器实现rpc服务(0个评论)
    • hyperf + 京东联盟sdk实现简单商品列表转链跳转购买商品功能示例(0个评论)
    • Hyperf 3.0版本发布(0个评论)
    • 近期文章
    • 在PHP提高性能方式之开启OPCache扩展及OPCache配置参数详解(0个评论)
    • 在js的websocket客户端开发中遇到代码割裂情况解决方案(0个评论)
    • Laravel框架中适用于Eloquent的日期过滤软件包:lara-date-filter(0个评论)
    • Laravel 10.24版本发布(0个评论)
    • go语言多项目批量更新依赖及自动调用jenkins构建流程步骤(0个评论)
    • 在go语言中实现数学pow(x^y 的幂次)代码示例(0个评论)
    • Laravel应用程序性能监控 (APM) 工具:Scout (0个评论)
    • 推荐一款针对git、diff和grep输出的语法高亮显示的扩展包:Git Delta(0个评论)
    • laravel框架中以公共函数方式实现job异步化执行封装代码示例(0个评论)
    • 在go语言中实现从http响应中解码JSON数据(0个评论)
    • 近期评论
    • 路人 在

      php中使用hyperf框架调用讯飞星火大模型实现国内版chatgpt功能示例中评论 教程很详细,如果加个前端chatgpt对话页面就完美了..
    • 博主 在

      科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 @ mashrdn 多切换几个节点测试,免费ssr是没那么稳..
    • mashrdn 在

      科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 V2rayn免费节点添加上去了,youtobe无法打开网页,是怎么回事..
    • 张伟 在

      科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 3q!有用,不过免费节点隔天就要去git上复制新的导进去..
    • 博主 在

      科学上网翻墙访问Google , 上外网神器佛跳墙VPN(永久免费)使用流程步骤中评论 该篇教程已不能用了,告知大家,免的老有老铁问我!..
    • 2017-09
    • 2020-03
    • 2020-06
    • 2021-03
    • 2021-04
    • 2021-05
    • 2021-07
    • 2021-08
    • 2021-09
    • 2021-11
    • 2022-03
    • 2022-05
    • 2023-01
    • 2023-02
    • 2023-03
    • 2023-07
    • 2023-08
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客