Installing PEAR on OSX

本文介绍如何在OSX系统上安装PEAR(PHP包管理器),包括检查是否已安装、下载安装包、设置权限、配置环境变量等步骤,并提供验证安装成功的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://androidren.com/index.php?qa=278&qa_1=installing-pear-on-osx

PEAR is a poplular PHP package manager, it doesn’t come by default on OSX, how to install PEAR on OSX 10.9 Mavericks and earlier versions of OSX.

Check if you have it

pear version

If not, move into:

cd /usr/local

Get it (一定要注意啊,curl -O,这里是大写的O,不是零。)

curl -Ohttp://pear.php.net/go-pear.phar

if you are denied permission try it withsudo

sudo curl -Ohttp://pear.php.net/go-pear.phar

Install It

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

Click yes a couple of times during the install

pear-mountain-lion-osx

Add PEAR to your PATH (有的时候,不需要添加这个path,因为他和系统的一起了,比如:/usr/bin/ 。这时候,你直接进入pear version,进行验证就好)

cd vi .bashrc

or

vi .bash_profile

Add to your PATH variable:

/Users/USERNAME/pear/bin

So the PATH variable line will look something like this, each path is separated by a colon and finished with the variable $PATH, in the example below thepearpath is the 2nd one

export PATH="/usr/local/mysql/bin:/Users/USERNAME/pear/bin:$PATH"

Refresh

source .bash_profile

Verify

pear version

Output should be

PEAR Version: 1.9.4 PHP Version: 5.4.17 Zend Engine Version: 2.4.0 Running on: Darwin admins-MacBook.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64

That’s PEAR installed and ready.
To upgrade PEAR
pear upgrade pear
To upgrade PEARpackages either name the package name after the command or to upgrade all just run

pear upgrade

装完pear后,其实pecl就已经包含了。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值