| Mac php安装pear使用pecl安装php拓展PearPEAR(PHP Extension and Application Repository)即php拓展和应用仓库  
 PEAR将php开发过程中常见的功能编写成类库,如网络协议,文件操作,数据操作,缓存操作等许多其他常用功能,用户可通过这些类库进行适当的开发已达到开发的目的,避免了用户重复造轮子的工作。大大提高了Php程序开发的效率和开发质量 PECL(PHP Extension Community Library)php扩展库  
 PECL可以看作是PEAR的一部分,提供了PEAR类似的功能。不同的是PEAR所有的拓展都是用纯php代码编写,而PECL使用C语言开发的。前者可直接将扩展的代码包含到自己的php项目中使用,而后者需要编译后才能使用。 一顿百度之后,发现都是复制黏贴,并没有解决我的问题。本文将引用官网的教程加以说明。 末尾会附上官方说明 通过curl下载pearcurl -O https://pear.php.net/go-pear.phar
 安装php -d detect_unicode=0 go-pear.phar
 考虑到权限问题还是加上sudo比较稳 sudo php -d detect_unicode=0 go-pear.phar
 接下来按顺序依次是 1:输入 1 回车 2:输入 /usr/local/pear 回车 3:输入 4 回车 4:输入 /usr/local/bin 回车 5:继续回车 以下是官方说明 Use curl as shown below to download the go-pear.phar file or just download the go-pear.phar file via your browser. $ curl -O https://pear.php.net/go-pear.phar
$ php -d detect_unicode=0 go-pear.phar
 ? You’re now ready to configure PEAR for installation. ? First you need to change the Installation Base. ? So type 1, and then press Enter.? Enter /usr/local/pear? Press Enter.
 ? Then, you will need to change the Binaries directory. ? Type 4, and then press Enter.? Enter /usr/local/bin? Press Enter.
 ? Once you have changed the Installation Base and the Binaries Directory, press Enter to install PEAR.  
 ? For a system-wide installation, you will need to execute the go-pear script with increased permissions. This is only recommended for advanced users. $ curl -O https://pear.php.net/go-pear.phar
$ sudo php -d detect_unicode=0 go-pear.phar
 使用pecl安装 xdebug扩展 arch -x86_64 sudo pecl install xdebug
 |