找不到'Grpc \ BaseStub类'

问题描述 投票:0回答:1

[尝试运行由protoc从一堆*.proto文件中生成的PHP客户端代码。 PHP代码在具有php7.3的docker容器上运行,并且安装并启用了GRPC扩展:pecl/grpc is already installed and is the same as the released version 1.23.1

当代码运行时,出现以下错误:Class 'Grpc\BaseStub' not found

错误由以下行触发:class ProductServiceClient extends \Grpc\BaseStub {。这是自动生成的代码中的一行,因此无法修改。

[编辑]运行composer require grpc/grpc解决了此问题;但是,我现在有Class 'Google\Protobuf\Internal\Message' not found

[编辑]运行composer require google/protobuf解决了第二个问题。

php grpc
1个回答
0
投票

尝试添加grpc库:

composer require grpc/grpc
© www.soinside.com 2019 - 2024. All rights reserved.