LoginSignup
1
1

More than 3 years have passed since last update.

Windows 版 PHP で gRPC を使う

Posted at

XAMPP for WindowsPHPgRPC エクステンションをインストールしたときの手順メモ
今回はプリコンパイル済みの dll をダウンロードしてインストールした

検証環境

Windows10 Home Edition
XAMPP for Windows 7.4.9 (x64)

PHP がスレッドセーフか確認

D:\>php --version
PHP 7.4.9 (cli) (built: Aug  4 2020 11:52:41) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.9, Copyright (c), by Zend Technologies
    with Xdebug v2.8.1, Copyright (c) 2002-2019, by Derick Rethans

D:\>php -i | grep -i thread
Thread Safety => enabled
Thread API => Windows Threads

XAMPP に付属している PHP はスレッドセーフ

gRPC エクステンションのセットアップ

ダウンロード

下記のサイトから dll のアーカイブをダウンロードする
PECL :: Package :: gRPC

2020-10-18 現在、最新の安定板は 1.32.0
PECL :: Package :: gRPC 1.32.0 for Windows

XAMPPPHP のバージョンは 7.4.9 ZTS x64 なので、7.4 Thread Safe (TS) x64 をダウンロードする
grpc_win_1.32.0.png

dll のインストール

ダウンロードしたファイルを解凍して php_grpc.dll\xampp\php\ext にコピーする
\xampp\php\php.ini に下記を追加

extension=grpc

動作確認

D:\>php -i | grep -i grpc
grpc
grpc support => enabled
grpc module version => 1.32.0
grpc.enable_fork_support => 0 => 0
grpc.grpc_trace => no value => no value
grpc.grpc_verbosity => no value => no value
grpc.log_filename => no value => no value
grpc.poll_strategy => no value => no value

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1