macOS 上安裝 PECL

一、簡介

PECL(The PHP Extension Community Library)是 PHP 擴(kuò)展的存儲庫,為 PHP 所有的擴(kuò)展提供提供托管和下載服務(wù)。

通過 PEAR(PHP Extension and Application Repository)的 Package Manager 的安裝管理方式,可以對 PECL 擴(kuò)展進(jìn)行下載和安裝。

二、安裝

官方提供了 PEAR 在各個平臺的安裝方式,直接看官方文檔的請進(jìn)【傳送門】,macOS 平臺官方安裝翻譯如下。

1. 下載 PEAR

使用 curl 命令下載即可:

$ curl -O https://pear.php.net/go-pear.phar

2. 安裝 PEAR

使用 sudo 授權(quán)進(jìn)行安裝:

$ sudo php -d detect_unicode=0 go-pear.phar

安裝過程需要進(jìn)行簡單的配置,如下:

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : /usr
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/bin
 5. PHP code directory ($php_dir)                 : /usr/share/pear
 6. Documentation directory                       : /usr/docs
 7. Data directory                                : /usr/data
 8. User-modifiable configuration files directory : /usr/cfg
 9. Public Web Files directory                    : /usr/www
10. System manual pages directory                 : /usr/man
11. Tests directory                               : /usr/tests
12. Name of configuration file                    : /private/etc/pear.conf

1-12, 'all' or Enter to continue: 1

輸入 1,將安裝根目錄修改為 /usr/local/pear;
輸入 4,將命令安裝到 /usr/local/bin 目錄;
其它選項(xiàng)默認(rèn)即可,一路回車。

3. 檢測是否安裝成功

出現(xiàn)如下結(jié)果,則安裝成功:

$ pear version
PEAR Version: 1.10.5
PHP Version: 7.1.7
Zend Engine Version: 3.1.0

三、相關(guān)連接

PECL 官方地址:http://pecl.php.net/
PEAR 官方地址:http://pear.php.net/


本文首發(fā)于馬燕龍個人博客,歡迎分享,轉(zhuǎn)載請標(biāo)明出處。
馬燕龍個人博客:http://www.mayanlong.com
馬燕龍個人微博:http://weibo.com/imayanlong
馬燕龍Github主頁:https://github.com/yanlongma

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 更改ip和dnsVi /etc/sysconfig/network-scripts/ifcfg-eth0vi /...
    Xwei_閱讀 2,024評論 0 3
  • Welcome 目前網(wǎng)絡(luò)上充斥著大量的陳舊信息,讓PHP新手誤入歧途,傳播著錯誤的實(shí)踐和糟糕的代碼,這必須得到糾正...
    layjoy閱讀 21,833評論 7 118
  • 前面章節(jié)我會先簡要說明一下安裝過程, 后面章節(jié)我會記錄在安裝期間踩過的坑.Linux 下編譯軟件的步驟參見Linu...
    patiencing閱讀 3,277評論 1 3
  • 由于前文“Centos 7.2 yum安裝php7”中升級了php到php7,導(dǎo)致之前可以正常使用的phpmyad...
    手表大大閱讀 1,601評論 0 0
  • 擴(kuò)展(Extension)一般偏底層,包(Application,Package)一般偏應(yīng)用。不建議做過分的區(qū)分,...
    biaoqianwo閱讀 5,421評論 0 6

友情鏈接更多精彩內(nèi)容