为本地主机安装 gRPC [英] Installing gRPC for localhost

查看:23
本文介绍了为本地主机安装 gRPC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

  • 根据你的PHP版本:

    • 对于带有 PHP > 7.2.15 的 XAMPP .. 选择 Thread Safe (TS) x64

    • 对于较旧的 XAMPP .. 选择 Thread Safe (TS) x86

  • 下载 ZIP 文件,然后提取其内容

  • php_grpc.dll文件复制到XAMPP中的extensions文件夹(路径可以在php.ini中找到)..在我的情况是 extension_dir="C:xamppphpext"
  • 在您的 php.ini 文件中启用扩展:

    • 对于 PHP 7.2 版 及更高版本.. 添加 extension=grpc

    • 对于旧 PHP .. 添加 extension=php_grpc.dll

  • 重启XAMPP,扩展将被激活,如phpinfo()
  • I'm working with PHP library of Google Cloud Firestore, it requires me to install and enable the gRPC extension.. I've read the guide which says

    Windows users can download and enable DLLs from PECL. Support for Windows is experimental

    In the PECL site I can see many links to tgz and DLL files but without any explanation of how to use or activate them in the XAMPP as a localhost

    解决方案

    With the help of this link.. I found that these steps will activate gRPC

    1. From PECL site (or windows.php.net which has the exact same files) .. choose DLL of the latest stable release

    2. According to the PHP version you have :

      • For XAMPP with PHP > 7.2.15 .. choose Thread Safe (TS) x64

      • For older XAMPP .. choose Thread Safe (TS) x86

    3. Download the ZIP file then extract its contents

    4. Copy the php_grpc.dll file to the extensions folder in XAMPP (you can find the path in php.ini) .. in my case it was extension_dir="C:xamppphpext"
    5. Enable the extension in your php.ini file :

      • For PHP version 7.2 and up .. add extension=grpc

      • For older PHP .. add extension=php_grpc.dll

    6. Restart XAMPP and the extension will be activated as showed in phpinfo()

    这篇关于为本地主机安装 gRPC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆