我使用的Mavericks自帶的php,沒有安裝MAMP。
- 首先我們需要安裝一個brew,這個網上有很多這方面的文章。
先安裝Git,打開一個shellcd /usr/local
sudo mkdir homebrew
curl -L https://github.com/mxcl/homebrew/tarball/master | sudo tar xz --strip 1 -C homebrew
cd homebrew/bin
./brew -v
file brew
cat brew | more
sudo ./brew update
如果“brew update”指令執行出錯,請確定檔案夾/usr/local的所有者權限是你本人而不是root:
sudo chown $USER /usr/localbrew updat
在".bash_profile"中更新路徑配置
(如果~下沒有檔案".bash_profile" 請執行: touch '.bash_profile' )
vim '.bash_profile'加入
export PATH=$PATH:/usr/local/homebrew/bin
之後可以直接執行brew(不用./brew)
如果有了Git可以這樣安裝(未測試)
git clone https://github.com/mxcl/homebrew.git
到這裡就安裝好了brew了
2.然後使用brew安裝ICU
打開指令行: brew install icu4c
3.然後開啟你的pear
sudo php /usr/lib/php/install-pear-nozlib.phar
sudo pear config-set php_ini /private/etc/php.ini
sudo pecl config-set php_ini /private/etc/php.ini
sudo pear upgrade-all
4.安裝intl