由于各系统间以及PHP版本间的差异,导致安装存在差异,特在此记录一下
ubuntu安装PECL
php5安装PECL
sudo apt-get install autoconf libz-dev php5-dev php-pear
php7安装PECL
在安装时需要根据自身PHP版本进行调整php-dev的安装,例:PHP7.0 => php7.0-dev,PHP7.2 => php7.2-dev
sudo apt-get install autoconf libz-dev php7.0-dev php-pear
CentOS安装PECL
在安装时需要根据自身PHP版本进行调整php-devel的安装,例:PHP5.6 => php56w-devel,PHP7.2 => php72w-devel
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm sudo yum install php56w-devel php-pear phpunit gcc zlib-devel
MACOS安装PECL
curl -O https://pear.php.net/go-pear.phar sudo php -d detect_unicode=0 go-pear.phar