macOS 上安装 PECL

一、简介

PECL(The PHP Extension Community Library)是 PHP 扩展的存储库,为 PHP 所有的扩展提供提供托管和下载服务。

通过 PEAR(PHP Extension and Application Repository)的 Package Manager 的安装管理方式,可以对 PECL 扩展进行下载和安装。

二、安装

官方提供了 PEAR 在各个平台的安装方式,直接看官方文档的请进【传送门】,macOS 平台官方安装翻译如下。

1. 下载 PEAR

使用 curl 命令下载即可:

$ curl -O https://pear.php.net/go-pear.phar

2. 安装 PEAR

使用 sudo 授权进行安装:

$ 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 ($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

1-12, ‘all‘ or Enter to continue: 1

输入 1,将安装根目录修改为 /usr/local/pear;

输入 4,将命令安装到 /usr/local/bin 目录;

其它选项默认即可,一路回车。

3. 检测是否安装成功

出现如下结果,则安装成功:

$ pear version
PEAR Version: 1.10.5
PHP Version: 7.1.7
Zend Engine Version: 3.1.0

三、相关连接

PECL 官方地址:http://pecl.php.net/

PEAR 官方地址:http://pear.php.net/


本文首发于马燕龙个人博客,欢迎分享,转载请标明出处。

马燕龙个人博客:http://www.mayanlong.com

马燕龙个人微博:http://weibo.com/imayanlong

马燕龙Github主页:https://github.com/yanlongma

原文地址:https://www.cnblogs.com/imayanlong/p/8447970.html

时间: 2024-07-31 07:43:31

macOS 上安装 PECL的相关文章

在macOS上不安装JDK的情况下安装Netbeans

标题有些绕,解释起来要从Java在桌面环境上的悲催现状开始. 现在几乎所有的网站都不用Java Applet,用Java编写的桌面应用几乎都是IDE.用Java编写的IDE们为了安装方便,几乎都内嵌了JRE.既然全都自带了JRE,Applet又没用,那还独立安装JRE干什么?那个安装的JRE还自动运行,动不动就要更新. 但是macOS上的Netbeans是个例外,Windows上的Netbeans已经不需要先安装JRE了. macOS已经事实上移除了Java,PhpStorm.Andriod S

如何在MacOS的VScode上安装Python3

由于MacOS上的VScode默认安装的Python版本是2.7,所以需要我们自己手动安装Python3 安装Homebrew 到Homebrew网站获取命令行 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 复制命令行到VScode终端执行,如果报错显示curl: (7) Failed to connect to raw.githubu

在macos上基于python2.7安装PyQt5

在python3上面安装PyQt5是十分简单的,可是,在python2.7上安装这个东西,着实让人折腾了一把.要总结一下,年纪大了,记性不好. 首先要安装最新版的Qt和python2,命令如下: brew install python qt5 接下来获取PyQt5的源码,命令如下: wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.6/PyQt5_gpl-5.6.tar.gz wget http://freefr.dl.so

macOS Sierra安装Apache2.4+PHP7.0+MySQL5.7.16

ac系统上虽然自带PHP和Apache,但是有时不是我们想要的版本呢.今天我们就在macOS Sierra(10.12.1)上安装比较新的版本的PHP版本,也就是PHP7.0+了.本篇博客我们安装的Apache是2.4的版本, MySQL5.7.16.稍后会详细介绍这一过程. 一.安装前的准备 1.安装或更新Homebrew Homebrew就不做过多赘述了,也不是在博客中第一次提到了,是Mac上不可或缺的包包管理器.下方截图中是我本地使用的brew的版本信息,当然是目前最新的版本.在安装上述相

CoreCRM 开发实录——Travis-CI 实现 .NET Core 程度在 macOS 上的构建和测试 [无水干货]

猿教程_-webapi教程-WebAPI教程 猿教程_-webapi教程-Web API概述 猿教程_-webapi教程-新建Web Api项目 猿教程_-webapi教程-测试Web API 猿教程_-webapi教程-Web API Controller 猿教程_-webapi教程-配置Web API 猿教程_-webapi教程-Web API路由 猿教程_-webapi教程-参数绑定 猿教程_-webapi教程-Action方法返回类型 猿教程_-webapi教程-Web API Requ

Mac Yosemite上安装macvim和YouCompleteMe

今天在macvim上安装YouCompleteMe的时候,碰到一个运行vim崩溃的错误.查了半天终于解决! 先上一下安装macvim的过程 # install xcode and command line tools $ xcode-select --install # install homebrew $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

linux上安装php7 memcache扩展 和 安装服务端memcached

linux上安装memcached不算太困难.唯一让本人感到困难的是 php7的memcache扩展安装.真的蛋疼! 先说安装服务端 memcached 1. 首先安装Libevent事件触发管理器. wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz tar vxf libevent-2.0.21-stable.tar.gz cd libevent-2.0.21-stable ./c

在CentOS上安装PowerShell

微软刚刚开源了PowerShell,目前在Linux和MacOS上都能安装.具体的链接如下: https://github.com/PowerShell/PowerShell 本文将介绍如何在CentOS 7.2下安装PowerShell. 首先在CentOS下下载PowerShell的安装包: wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell-6.0.0_alpha

【使用笔记】git在macos上的使用初步

我的基本需求:在macos上本地写的代码,期望备份到云端服务器上.本地代码有一定的目录结构 1. 注册github账号 到www.github.com上注册账号(用户名+email地址),并创建目录 2. 将本地机器与github账相关联 将本地机器与github账号关联之后,本地机器就可以同服务器同步代码了.github使用ssh协议. 具体来说: 到 https://github.com/settings/ssh 里面进行设置. 具体步骤遵循这里的指示:https://help.github