方法一、
yum install php-pear php-devel (安装pecl等php附属)
pecl install msgpack You should add "extension=msgpack.so" to php.ini
pecl install yar
You should add "extension=
yar
.so" to php.ini
方法二、
$ git clone
https://github.com/msgpack/msgpack.git
$ cd msgpack/php
$ /var/www/php7/bin/phpize
$ ./configure --with-php-config=/usr/local/php7/bin/php-config
$ make
$ make install
在php.ini 里添加如下内容.
extension=msgpack.so
$wget http://pecl.php.net/get/yar-1.1.1.tgz
$tar xvzf yar-1.1.1.tgz
$/var/www/php5/bin/phpize
$./configure --with-php-config=/usr/local/php7/bin/php-config
$make & make install
然后会生成yar.so文件在php扩展目录里。
在php.ini 里添加如下内容.
extension=yar.so
重启php和nginx
php_info(); 查看是否安装成功!