Pecl全稱The PHP Extension Community Library,php社區擴展庫,由社區編寫,維護。
使用pecl方便之處在於我們不用到處找源碼包下載編譯,配置,不用手動phpize,configure,make,make install,自動識別模塊安裝路徑,
我們只需要編輯php.ini配置文件開啟擴展,當然我們也需要自己配置一些參數的時候可以先下載源碼再構建
安裝pecl
Apt
sudo apt install php-dev php-pear autoconf automake libtool -y
Yum
sudo yum install php-dev php-pear autoconf,automake,libtool -y
pecl常用命令
build 從C的源碼中構建擴展 install 安裝一個包,步驟包含(configure,make,make install) download 下載源碼包 list-all 列出全部包 run-tests 運行測試(make test)
引用:https://www.myfreax.com/install-the-php-extension-with-pecl/