Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP grpc扩展不在WAMP上工作,尽管在CLI上工作_Php_Google Cloud Datastore_Wamp_Extension Methods - Fatal编程技术网

PHP grpc扩展不在WAMP上工作,尽管在CLI上工作

PHP grpc扩展不在WAMP上工作,尽管在CLI上工作,php,google-cloud-datastore,wamp,extension-methods,Php,Google Cloud Datastore,Wamp,Extension Methods,在尝试用PHP安装Firestore的grpc大约一周后,我成功地让它工作了,但是只有在terminals/cmd中运行时。这个php.ini/环境位于我的桌面上的一个文件夹中,当使用firestore命令执行文件时,它可以工作。没有错误 但是,在WAMP中,它会导致页面崩溃: Fatal error: Uncaught Google\Cloud\Core\Exception\GoogleException: The requested client requires the gRP

在尝试用PHP安装Firestore的grpc大约一周后,我成功地让它工作了,但是只有在terminals/cmd中运行时。这个php.ini/环境位于我的桌面上的一个文件夹中,当使用firestore命令执行文件时,它可以工作。没有错误

但是,在WAMP中,它会导致页面崩溃:

      Fatal error: Uncaught Google\Cloud\Core\Exception\GoogleException: The requested client requires the gRPC extension. Please see https://cloud.google.com/php/grpc for installation instructions. in D:\wamp64\www\karma\vendor\google\cloud-core\src\ClientTrait.php:76 Stack trace: #0 D:\wamp64\www\karma\vendor\google\cloud-firestore\src\FirestoreClient.php(139): Google\Cloud\Firestore\FirestoreClient->requireGrpc() #1 D:\wamp64\www\karma\functions.php(32): Google\Cloud\Firestore\FirestoreClient->__construct(Array) #2 D:\wamp64\www\karma\Firestore.php(8): Firestore->__construct('test') #3 {main} thrown in D:\wamp64\www\karma\vendor\google\cloud-core\src\ClientTrait.php on line 76
现在真正奇怪的是,我从桌面复制了这个目录,并将它粘贴到WAMP PHP区域中,没有任何区别。它甚至在配置中说php_grpc已加载!我不认为需要最底层的DLL,所以我不认为这是缺少DLL的问题,但我觉得非常奇怪桌面上的同一个目录将从命令行运行php文件,而不是在WAMP中。WAMP是64位的,插件也是64位的。wamp的PHP版本是7.0.1,但我用新的7.4.x版本替换了整个7.0.1文件夹,就像该版本的插件一样


为什么它会说它已加载,但又说它未加载?

我也有同样的问题。我尝试了所有可能的方法来修复它。扩展在waamp中加载,但php显示丢失的错误。

我必须完全重新安装wamp以修复此错误,在新目录中重新安装php,并确保我有正确的grpc版本。我不知道是什么导致了这个错误,但是请尝试每一个最近的grpc版本(我认为有四个),并确保在您的配置文件中,每一次添加都复制了该格式


我在WAMP之外安装了一个新的php,它可以正常工作,但由于WAMP本身也有一个漏洞,我将在这里发布我的答案,请查看。我花了大约10天的时间才弄明白。