CentOS7.X下安装Gearman-1.1.17及其PHP-7.X扩展

简介: CentOS7.X下安装Gearman-1.1.17及其PHP-7.X扩展

CentOS下安装Gearman及其PHP扩展

  1. 本文由原官方文档翻译而来

安装Gearman

  1. 安装前的准备

    # CentOS
    yum install \
    vim \
    git \
    gcc \
    gcc-c++ \
    wget \
    make \
    gperf \
    automake \
    autoconf \
    boost-devel \
    libuuid-devel \
    libevent-devel \
    -y \
  2. 安装gearmand
    源码地址
    源码下载

    cd /root
    wget https://github.com/gearman/gearmand/releases/download/1.1.17/gearmand-1.1.17.tar.gz
    tar -zxvf gearmand-1.1.17.tar.gz
    cd gearmand-1.1.17
    ./configure \
    --prefix=/usr/local/gearman/ \
    --disable-libpq \
    --disable-hiredis \
    --disable-libdrizzle \
    --disable-silent-rules \
    --disable-libtool-lock \
    --disable-libmemcached \
    --disable-option-checking \
    --disable-libtokyocabinet \
    --disable-dependency-tracking \
    make
    make install
  3. 创建gearman用户

    useradd -s /sbin/nologin -M gearman
    
    mkdir /usr/local/gearman/var/
    mkdir /usr/local/gearman/var/log/
    chown -R gearman:gearman /usr/local/gearman/
  4. 启动gearman并设置开机启动

    # 进入单元文件目录
    cd /etc/systemd/system
    
    # 创建redis单元文件,格式为: [单元文件名].[单元文件类型]
    vim gearman.service
    
    [Unit]
    Description=Start gearman on boot.
    After=default.target network.target
    
    [Service]
    User=gearman
    Group=gearman
    Type=forking
    PIDFile=/usr/local/gearman/var/log/gearmand.pid
    ExecStart=/usr/local/gearman/sbin/gearmand --log-file=/usr/local/gearman/var/log/gearmand.log --pid-file=/usr/local/gearman/var/log/gearmand.pid -d
    ExecReload=/bin/kill -s HUP $MAINPID
    ExecStop=/bin/kill -s QUIT $MAINPID
    PrivateTmp=false
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    
    ESC
    :wq
    
    # 修改文件权限为只有root用户可以编辑该文件
    chown -R root:root /etc/systemd/system/gearman.service
    chmod -R 644 /etc/systemd/system/gearman.service
    
    # 更新systemd
    systemctl daemon-reload
    systemctl enable gearman
    systemctl start gearman
  5. 领支付宝红包支持作者

    扫码领支付宝红包

    安装php扩展

  6. 安装php的gearman扩展
    *Gearman地址
    *Gearman下载

    yum install libgearman-devel -y
    cd ~
    wget https://github.com/wcgallego/pecl-gearman/archive/gearman-2.0.3.tar.gz
    tar -zxvf gearman-2.0.3.tar.gz
    cd pecl-gearman-gearman-2.0.3
    phpize
    ./configure
    make
    make install
  7. 修改php.ini

    vim /usr/local/gearman/php-7.0.13/lib/php.ini
    
    extension=gearman.so
    
    ESC
相关文章
|
11天前
|
存储 安全 Linux
CentOS安装SeaweedFS
通过上述步骤,您应该能够在CentOS系统上成功安装并启动SeaweedFS。记住,根据实际部署规模和需求,可能还需要进一步调整配置参数和优化网络布局。SeaweedFS的灵活性和扩展性意味着随着使用深入,您可能需要探索更多高级配置和管理策略。
94 64
|
12天前
|
存储 安全 Linux
CentOS安装SeaweedFS
通过上述步骤,您应该能够在CentOS系统上成功安装并启动SeaweedFS。记住,根据实际部署规模和需求,可能还需要进一步调整配置参数和优化网络布局。SeaweedFS的灵活性和扩展性意味着随着使用深入,您可能需要探索更多高级配置和管理策略。
100 61
|
5天前
|
Linux 网络安全 数据安全/隐私保护
Linux系统之Centos7安装cockpit图形管理界面
【10月更文挑战第12天】Linux系统之Centos7安装cockpit图形管理界面
24 1
Linux系统之Centos7安装cockpit图形管理界面
|
11天前
|
NoSQL 数据可视化 Linux
redis学习四、可视化操作工具链接 centos redis,付费Redis Desktop Manager和免费Another Redis DeskTop Manager下载、安装
本文介绍了Redis的两个可视化管理工具:付费的Redis Desktop Manager和免费的Another Redis DeskTop Manager,包括它们的下载、安装和使用方法,以及在使用Another Redis DeskTop Manager连接Redis时可能遇到的问题和解决方案。
36 1
redis学习四、可视化操作工具链接 centos redis,付费Redis Desktop Manager和免费Another Redis DeskTop Manager下载、安装
|
18天前
|
Linux Docker 容器
Centos安装docker(linux安装docker)——超详细小白可操作手把手教程,包好用!!!
本篇博客重在讲解Centos安装docker,经博主多次在不同服务器上测试,极其的稳定,尤其是阿里的服务器,一路复制命令畅通无阻。
114 4
Centos安装docker(linux安装docker)——超详细小白可操作手把手教程,包好用!!!
|
8天前
|
NoSQL Linux Redis
Docker学习二(Centos):Docker安装并运行redis(成功运行)
这篇文章介绍了在CentOS系统上使用Docker安装并运行Redis数据库的详细步骤,包括拉取Redis镜像、创建挂载目录、下载配置文件、修改配置以及使用Docker命令运行Redis容器,并检查运行状态和使用Navicat连接Redis。
64 3
|
8天前
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤
本文介绍了在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置服务等,并与使用 RPM 包安装进行了对比,帮助读者根据需求选择合适的方法。编译源码安装虽然复杂,但提供了更高的定制性和灵活性。
64 2
|
10天前
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤
【10月更文挑战第7天】本文介绍了在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。同时,文章还对比了编译源码安装与使用 RPM 包安装的优缺点,帮助读者根据自身需求选择合适的方法。
19 3
|
21天前
|
tengine 应用服务中间件 Linux
Tengine、Nginx安装PHP命令教程
要在阿里云Linux上安装PHP,请先更新YUM源并启用PHP 8.0仓库,然后安装PHP及相关扩展。通过`php -v`命令验证安装成功后,需修改Nginx配置文件以支持PHP,并重启服务。最后,创建`phpinfo.php`文件测试安装是否成功。对于CentOS系统,还需安装EPEL源和Remi仓库,其余步骤类似。完成上述操作后,可通过浏览器访问`http://IP地址/phpinfo.php`测试安装结果。
|
15天前
|
Kubernetes Linux 开发工具
centos7通过kubeadm安装k8s 1.27.1版本
centos7通过kubeadm安装k8s 1.27.1版本