1. 程式人生 > >mac 安裝 pecl

mac 安裝 pecl

下載安裝前注意目錄的許可權,可以自己新建個目錄給許可權

1、下載pear.phar,沒有許可權在前面加上sudo

curl -O  http://pear.php.net/go-pear.phar

2、安裝pear

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

3、測試

pear version

安裝成功!

安裝完成後如果出現下面這個錯誤:
Cannot install, php_dir for channel “pecl.php.net” is not writeable by the current user

就執行下面這個命令設定目錄
pecl config-set php_dir /path/to/new/dir