1、下載pear.phar,沒有權限在前面加上sudo
<code>curl -O http://pear<span>.php</span><span>.net</span>/go-pear<span>.phar</span></code>
2、安裝pear
<code><span>sudo</span> php <span>-d</span> detect_unicode=<span>0</span> go-pear.phar</code>
3、測試
安裝成功! 安裝完成後如果出現下面這個錯誤:
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