• php通过pecl方式安装扩展


    安装pecl

    cd /usr/local/php/bin/
    wget http://pear.php.net/go-pear.phar -O go-pear.php
    php go-pear.php
    ##回车默认安装

    yum安装
    yum install php-pear

    安装php扩展

    pecl search key-word    #查找扩展
    pecl install key-word   #安装扩展

    查询相关扩展

    [root@localhost src]# pecl search swoole
    Retrieving data...0%
    Matched packages, channel pecl.php.net:
    =======================================
    Package Stable/(Latest) Local
    swoole  1.8.12 (stable) 1.8.12 Event-driven asynchronous and concurrent networking engine with high performance for PHP.
    [root@localhost src]# pecl search xdebug
    Retrieving data...0%
    Matched packages, channel pecl.php.net:
    =======================================
    Package Stable/(Latest) Local
    xdebug  2.4.1 (stable)        Provides functions for function traces and profiling

    安装相关扩展

    pecl install xdebug
    ##安装完成之后,输出
    Build process completed successfully
    Installing '/usr/lib64/php/modules/xdebug.so'
    install ok: channel://pecl.php.net/xdebug-2.4.1
    configuration option "php_ini" is not set to php.ini location
    You should add "zend_extension=/usr/lib64/php/modules/xdebug.so" to php.ini
    ##根据提示,我们在php.ini的最后添加
    zend_extension=/usr/lib64/php/modules/xdebug.so
    pecl install swoole

    问题

     configure: error: Cannot find php-config

    在/usr/bin下执行 ln -s /usr/local/php/bin/php-config php-config 即可

    卸载

    php.ini 中删除 extension=swoole.so
    
    卸载,切换到PHP安装目录下的bin
    
    ./pecl uninstall swoole(已swoole为例)

     

  • 相关阅读:
    linux 下 设置 MySQL8 表名大小写不敏感方法,解决设置后无法启动 MySQL 服务的问题
    JavaWeb入门_模仿天猫整站Tmall_JavaEE实践项目
    flowable工作流笔记
    bladex前端反向代理(解决跨域)
    Long类型传值前端精度丢失
    blade普通字典关联
    一些东西
    java面试题经典解读
    html元素定位原理
    行转换为列
  • 原文地址:https://www.cnblogs.com/duandian/p/9512858.html
Copyright © 2020-2023  润新知