mac安装pear

1、下载Pear
curl -O https://pear.php.net/go-pear.phar
2、安装Pear
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.

在这里插入代码片1. Installation base ( p r e f i x ) : / u s r 2. T e m p o r a r y d i r e c t o r y f o r p r o c e s s i n g : / t m p / p e a r / i n s t a l l 3. T e m p o r a r y d i r e c t o r y f o r d o w n l o a d s : / t m p / p e a r / i n s t a l l 4. B i n a r i e s d i r e c t o r y : / u s r / b i n 5. P H P c o d e d i r e c t o r y ( 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 ( prefix):/usr2.Temporarydirectoryforprocessing:/tmp/pear/install3.Temporarydirectoryfordownloads:/tmp/pear/install4.Binariesdirectory:/usr/bin5.PHPcodedirectory(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 目录;
其它选项默认即可,一路回车。

检测是否安装成功
输入 pear version

pear version
如果现实如下信息,则安装成功

PEAR Version: 1.10.5
PHP Version: 7.1.7
Zend Engine Version: 3.1.0
如果还是显示

command not found: pear
则可能是pear的环境变量没有配置

打开bash.profile

open ~/.bash_profile
添加pear的路径

export PATH="/usr/bin/pear:$PATH"
保存配置

source ~/.bash_profile
再次执行pear version查看信息即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值