php+grpc+pb

VPS必备:yum -y install gcc automake autoconf libtool make

error: C++ preprocessor "/lib/cpp" fails sanity check 则安装gcc-c++   yum install gcc-c++

grpc等需要zlib

yum install zlib-devel

安装源

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum install php71w php71w-cli php71w-common php71w-devel php71w-fpm php71w-gd php71w-mbstring php71w-mysqlnd php71w-pdo php71w-process php71w-soap php71w-tidy php71w-xml php71w-pear 

安装pecl

yum install php71w-pear  (71w为对应版本,可以是)

安装grpc 扩展

pecl install grpc

error: zlib.h: No such file or directory 则安装zlib-devel , yum install zlib-devel

安装完成,新增文件 /usr/lib64/php/modules/grpc.so

vi  /etc/php.d/grpc.ini

输入内容

; Enable grpc extension module

extension=grpc.so

-----------安装grpc扩展已可使用grpc,pb扩展非必须-----------------------------

安装pb扩展

pecl install protobuf 或 pecl install protobuf-{VERSION}

安装完成,新增文件 /usr/lib64/php/modules/protobuf.so

vi  /etc/php.d/protobuf.ini

输入内容

; Enable protobuf extension module

extension=protobuf.so

------------------------------------------------------------------

yum install php71w php71w-cli php71w-common php71w-devel php71w-fpm php71w-gd php71w-mbstring php71w-mysqlnd php71w-pdo php71w-process php71w-soap php71w-tidy php71w-xml php71w-pear zlib-devel

-------------------------------------------------------------------

composer  require  "nmred/kafka-php"  -vvv

你可能感兴趣的:(php+grpc+pb)