当前位置:网站首页>php中使用google protobuf协议环境配置
php中使用google protobuf协议环境配置
2022-06-25 22:05:00 【ndrandy】
需要安装两个东西
- protoc编译器
- php-protobuf扩展
注意:protoc和php扩展的版本必须保持一致,这边以V3.9.1为例
网络上很多文章,安装了PHP扩展之后,还需要composer去加载,纯属误导,扩展方式和composer二选一即可
安装方法:
- 安装protoc
~# cd /data
~# wget -c https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protoc-3.9.1-linux-x86_64.zip
~# unzip protoc-3.9.1-linux-x86_64.zip
~# cd bin/
~# mv protoc /usr/bin/
~# protoc --version
libprotoc 3.9.1
- 安装php-protobuf扩展 (扩展安装和自己php安装的路径有关系,自己根据情况微调)
~# wget -c https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protobuf-php-3.9.1.zip
~# unzip protobuf-php-3.9.1.zip
~# cd protobuf-3.9.1/php/ext/google/protobuf
~# /opt/php/bin/phpize
~# ./configure --with-php-config=/opt/php/bin/php-config
~# make
~# make install
phpinfo查看能看到:
protobuf
Version => 3.9.1
到这边,整个环境已顺利配置完成
边栏推荐
- UE4 learning record 2 adding skeleton, skin and motion animation to characters
- mysql
- Uniapp -- list page of multi header tabs
- Mutual conversion between QT utf8 and Unicode encoding, and the Unicode encoding output format is &xxxxx
- String object (constant) pool
- Customize the qcombobox drop-down box, right align the display, and slide the drop-down list
- C2. k-LCM (hard version)-Codeforces Round #708 (Div. 2)
- C. Yet Another Card Deck-Educational Codeforces Round 107 (Rated for Div. 2)
- ACM. Hj16 shopping list ●●
- Reproduction of an implant found by Kaspersky that writes shellcode into evenlog
猜你喜欢
How does excel translate Chinese words into English automatically? This formula teaches you
Kotlin空指针Bug
Architecture part -- the use of UMI framework and DVA
Kotlin null pointer bug
Hibernate core api/ configuration file / L1 cache details
第六章 习题(678)【微机原理】【习题】
Binary, hexadecimal, big end and small end
Gradle的环境安装与配置
Visual studio code create minimal web API (asp.net core)
UE4 learning records create a role and control its movement
随机推荐
util. Collection and encapsulation of JS tool functions
BI-SQL丨存储过程(一)
转载: QTableWidget详解(样式、右键菜单、表头塌陷、多选等)
SSL/TLS、对称加密和非对称加密和TLSv1.3
实例:用C#.NET手把手教你做微信公众号开发(21)--使用微信支付线上收款:H5方式
Audio basics and PCM to WAV
Qlabel text scrolling horizontally
解决TypeError: Unicode-objects must be encoded before hashing
OpenResty篇01-入门简介和安装配置
二进制、16进制、大端小端
Leetcode (605) -- flower planting
DPVS-FullNAT模式管理篇
mysql集群
解析产品开发失败的5个根本原因
4个要点,助力产品管好项目
Screen recording to GIF is an easy-to-use gadget, screentogif, which is free and easy to use!
QComboBox下拉菜单中有分隔符Separator时的样式设置
mongodb
Tree class query component
DPVS-FullNAT模式keepalived篇