Search code examples
xamppgoogle-cloud-firestoregrpc

Installing gRPC for localhost


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


Solution

  • 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 enter image description here

    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:\xampp\php\ext"
    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()

    enter image description here