我目前正試圖解析一個.proto文件到php中。我試過使用DrSlump's Protobuf Parser 但是我的知識太小或我的Godaddy虛擬主機缺少一些東西。我用我的知識嘗試了一切,沒有成功去獲得我想要的東西。解析.proto到php類
所以我的問題,有沒有一步一步教程如何讓這個工作?
我有protoc用SSH安裝並還安裝
pear channel-discover pear.pollinimini.net
pear install drslump/Protobuf-beta
當前問題:
[email protected]:~/Root/var/www/xxx.com/web/test# protoc-gen-php
Protobuf-PHP 0.9.4 by Ivan -DrSlump- Montes
Error: You must provide at least 1 argument.
Type "/usr/bin/protoc-gen-php --help" to get help.
[email protected]:~/Root/var/www/xxx.com/web/test# php protoc-gen-php.php LandData.proto
Protobuf-PHP @[email protected] by Ivan -DrSlump- Montes
/var/www/clients/client1/web10/web/test/LandData.proto:
File does not reside within any path specified using --proto_path (or -I).
You must specify a --proto_path which encompasses this file.
Note that the proto_path must be an exact prefix of
the .proto file names --protoc is too dumb to figure out when two
paths (e.g. absolute and relative) are equivalent
(it's harder than you think).
ERROR: protoc exited with an error (1) when executed with:
protoc \--plugin=protoc-gen-php='/var/www/clients/client1/
web10/web/test/protoc-gen-php.php' \
--proto_path='/var/www/clients/client1/web10/web/test/
library/DrSlump/Protobuf/Compiler/protos' \--php_out=':./' \
'/var/www/clients/client1/web10/web/test/LandData.proto'