1、下载pear.phar,没有权限在前面加上sudo
curl -O http://pear.php.net/go-pear.phar
1
2、安装pear
sudo php-ddetect_unicode=0go-pear.phar
1
3、测试
pear version
红色为错误。黄色为错误提示。黑色为正确。
1.下载peal
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
出错:
301 Moved Permanently
Moved Permanently
划掉均为错误的。
执行:
下载:curl -O https://pear.php.net/go-pear.phar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3523k 100 3523k 0 0 159k 0 0:00:22 0:00:22 --:--:-- 246k
1.2安装:sudo php -d detect_unicode=0 go-pear.phar
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.
选择All,按顺序输入以下12个路径
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
====
新版本macos好像有问题,在上面的基础上修改1跟4的配置。
输入1,回车,配置pear路径为:/usr/local/pear
输入4,回车,配置命令路径为:/usr/local/bin