gpt4 book ai didi

php - 在 'Google\Protobuf\Internal\Message' 中找不到类 "Message.proto"

转载 作者:搜寻专家 更新时间:2023-10-31 21:22:20 24 4
gpt4 key购买 nike

我正在使用 protocol buffers 进行一个项目在我编译了一个原型(prototype)文件之后,我似乎无法包含它,也无法运行它,因为它一直给我这个确切的错误:PHP fatal error :在第 13 行的/app/generated_files/message.php 中找不到类“Google\Protobuf\Internal\Message”

message.php 上,我有一个从 .proto 文件自动生成的文件,它包括 Google\Protobuf\Internal\Message

protobuf github issues 上阅读时,我发现一个人有同样的问题,他断定这是 Composer 的错。但是,就我而言,这不是问题,因为我没有使用 Composer 。

我使用 pecl 来安装 Protocol Buffer ,并且我的库 protobuf.so 位于 /etc/php5/apache2/XXXXXXXXX。我还在 php.ini 的最后一行添加了 extension=protobuf.so

请记住,我对一切都使用 docker,因此它可能有所不同,但我仍然怀疑。

最佳答案

如果有人在这里遇到同样的问题:您只需要将 componser autoloader 添加到您的文件 include_once './vendor/autoload.php';(根据需要更改路径)

关于php - 在 'Google\Protobuf\Internal\Message' 中找不到类 "Message.proto",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44090688/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com