1、下载protobufc

https://github.com/google/protobuf/releases/download/v3.5.0/protoc-3.5.0-win32.zip
解压后放d:\protoc,将d:\protoc\bin加入PATH

2、下载使用drslump/Protobuf-PHP

进入https://github.com/drslump/Protobuf-PHP,点击clone or download按钮,下载后放E:\source\Protobuf-PHP

3、转换proto文件为php文件

test2.proto也放在E:\source\Protobuf-PHP

syntax = "proto3";
message PhoneNumber {
string number = 1;
int32 type = 2;
}

message Person {
string name = 1;
int32 id = 2;
string email = 3;
repeated PhoneNumber phone = 4;
double money = 5;
}

message AddressBook {
repeated Person person = 1;
}

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

e:

cd source/Protobuf-PHP-master

protoc --plugin=protoc-gen-php=.\protoc-gen-php.php --proto_path=./ --php_out=./out ./test2.proto

生成的文件放的out目录里

GPBMetadata/test2.php
AddressBook.php
Person.php
PhoneNumber.php

windows下php使用protobuf的更多相关文章

  1. windows下怎么安装protobuf for python

    首先从google上下载protobuf-3.0.0.zip和protoc-3.0.0-win32.zip,然后把protoc-3.0.0-win32.zip里的protoc.exe放到protobu ...

  2. Windows下编译Google.Protobuf在Qt(C++)中使用与Unity3d(C#)交互

    1.首先从Github-Protobuf下载代码,本文下载的版本号是3.1.0. 2.仔细查看各个README,有相关的资源下载和编译说明. 3.在一个方便的地方创建一个Install类型的文件夹,放 ...

  3. 【神经网络与深度学习】【Python开发】Caffe配置 windows下怎么安装protobuf for python

    首先从google上下载protobuf-2.5.0.zip和protoc-2.5.0-win32.zip,然后把protoc-2.5.0-win32.zip里的protoc.exe放到protobu ...

  4. google protobuf学习笔记:windows下环境配置

    欢迎转载,转载请注明原文地址:http://blog.csdn.net/majianfei1023/article/details/45371743 protobuf的使用和原理,请查看:http:/ ...

  5. windows下使用vs进行Proctocol Buffer开发(C++篇)

    因工作原因接触Proctocol Buffer(protobuf),至于什么是protobuf,为何使用protobuf,我就不赘述了,百度下都是答案. 今天我介绍的是在windows下使用vs进行p ...

  6. Chapter 7 Windows下pycaffe的使用之draw_net.py

    Chapter 6 中完成了在Windows下,对pycaffe的编译,如果编译存在问题,请参考:http://www.cnblogs.com/xiaopanlyu/p/6158902.html 本文 ...

  7. windows下使用python googleprotobuf

    首先下载:protobuf-2.5.0.tar.gz 和protoc-2.5.0-win32.zip.两者的版本要对应: 将下载的google protobuf解压,会看到一个python目录,Win ...

  8. 如何在Windows下用cpu模式跑通py-faster-rcnn 的demo.py

    关键字:Windows.cpu模式.Python.faster-rcnn.demo.py 声明:本篇blog暂时未经二次实践验证,主要以本人第一次配置过程的经验写成.计划在7月底回家去电脑城借台机子试 ...

  9. Windows下用cpu模式跑通目标检测py-faster-rcnn 的demo.py

    关键字:Windows.cpu模式.Python.faster-rcnn.demo.py 声明:原文发表在博客园,未经允许不得转载!!!本篇blog过程已经多名读者实践验证,有人反馈报错TypeErr ...

随机推荐

  1. RNAcentral 数据库简介

    RNAcentral 是EBI 开发的一个非编码RNA的数据库. 网址如下: http://rnacentral.org/ RNAcentral 整合了包括 Ensembl, GENCODE,Gree ...

  2. Getting Started with Google Guava.pdf

  3. 获取GridView中RowCommand的当前索引行(转)

    获取GridView中RowCommand的当前索引行 前台添加一模版列,里面添加一个LinkButton 前台 (如果在后台代码中用e.CommandArgument取值的话前台代码就必须在按钮中设 ...

  4. 使用intellij idea打包并部署到外部的tomcat

    1.使用intellij idea创建项目demotest File -> New -> Project-> Spring Initializr,根据提示一步步操作 会生成一个带有 ...

  5. 使用jstl+el表达式遇到的几个问题

    1.使用jstl访问Map<Integer,String>中的内容时总取不到? el表达式的一个bug,在解析数字的时候,会自动将数字转换成Long类型. 我的解决办法是,Map的key改 ...

  6. SVN服务器多个项目的权限分组管理

    1.创建两个代码仓库 cd /home/svn svnadmin create project1 svnadmin create project2 2. 复制 authz  passwd 两文件到SV ...

  7. PyCharm搭建pyqt5开发环境

    PyCharm搭建PyQt5开发环境 1.安装PyQt5 2.PyCharm环境配置 2.1 添加QtDesigner 2.2 添加PyUIC 2.3 添加Pyrcc 2.4 添加assistant ...

  8. html 内联函数宽度设置

    width and/or height in tables are not standard anymore; as Ianzz says, they are depreciated. Instead ...

  9. linux系统调用函数---12

    Linux应用编程学习笔记                                 周学伟 一.系统调用文件编程   1.文件打开函数 /*************************** ...

  10. 九个PHP很有用的功能

    1. 函数的任意数目的参数 你可能知道PHP允许你定义一个默认参数的函数.但你可能并不知道PHP还允许你定义一个完全任意的参数的函数 下面是一个示例向你展示了默认参数的函数: // 两个默认参数的函数 ...