求助,Thinkphp中如何调用php扩展呢?

浏览:791 发布日期:2018/07/10 分类:求助交流 关键字: php扩展
我安装了php的grpc扩展,直接使用php命令行可以正常调用
[root@localhost softEval]# php greeter_client.php
Hello world

greeter_client.php中调用扩展的代码:
function greet($name)
{
$client = new Helloworld\GreeterClient('localhost:50051', [
'credentials' => \Grpc\ChannelCredentials::createInsecure(),
]);
$request = new Helloworld\HelloRequest();
$request->setName($name);
list($reply, $status) = $client->SayHello($request)->wait();
$message = $reply->getMessage();

return $message;
}


但是在Thinkphp框架中,我用一样的方法调用该扩展函数,
$channel_credentials = \Grpc\ChannelCredentials::createInsecure();

却提示:
Class 'Grpc\ChannelCredentials' not found

有哪位大神知道thinkphp框架中, 如何调用php的扩展吗?
多谢!
最佳答案
评论( 相关
后面还有条评论,点击查看>>