对于一个项目,我想从Firebase,使用PHP的Firestore测试新数据库。但是在我可以使用它之前,我需要一些工具。我现在正在努力工作一天,但没有成功。 我被gRPC卡住了。我安装了,并且可以在Mac上使用,并且可以使用Composer安装Firestore,但无法使其与XAMPP一起使用。 当我加载页面时,我得到
严重错误:未捕获到Google \ Cloud \ Core \ Exception \ GoogleException:请求的客户端需要gRPC扩展名。 有关安装说明,请参见https://cloud.google.com/php/grpc。在/vendor/google/cloud-core/src/ClientTrait.php:75中的堆栈跟踪:#0 /vendor/google/cloud-firestore/src/FirestoreClient.php(115):Google \ Cloud \ Firestore \ FirestoreClient-> requireGrpc ()#1 /app/firebase.php(18):Google \ Cloud \ Firestore \ FirestoreClient-> __ construct()#2 /app/firebase.php(21):App \ initialize()#3 /template.php( 688):require_once('/ Applications / X ...')#4 /template.php(647):load_template('/ Applications / X ...',true)#5 / App in / vendor / google / cloud -core / src / ClientTrait.php,第75行
我将extension = grpc.so添加到XAMPP加载的php.ini中。 但是没有成功。
答案 0 :(得分:0)
尝试使用DLL文件,请从此处https://pecl.php.net/package/gRPC下载
答案 1 :(得分:0)
打开您的php.ini
文件,并取消注释行extension_dir="ext"
,
添加extension="grpc"
。
然后转到属性中的环境变量,在系统变量中选择path并添加您正在使用的php路径。
我正在使用C:\xampp\php
,在那里所有的魔力都会发生,这是战争的标记。