PHPBrewでredis拡張をインストール

1. 環境

インストールする環境はこんな感じ

$ sw_vers
ProductName:	macOS
ProductVersion:	11.3
BuildVersion:	20E232

$ phpbrew --version
phpbrew - 1.27.0
cliframework core: 2.5.4

$ phpbrew list
* php-7.4.13
  php-7.3.25

$ php -v
PHP 7.4.13 (cli) (built: Dec  4 2020 21:48:53) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

2. インストール

$ phpbrew ext install redis
Downloading https://pecl.php.net/rest/r/redis/stable.txt via curl extension
[==================================================================] 5.00/5.00B 100%
Downloading https://pecl.php.net/rest/r/redis/5.3.4.xml via curl extension
[==================================================================] 1.45/1.45KB 100%
Downloading https://pecl.php.net/rest/r/redis/stable.txt via curl extension
[==================================================================] 5.00/5.00B 100%
Downloading https://pecl.php.net/rest/r/redis/5.3.4.xml via curl extension
[==================================================================] 1.45/1.45KB 100%
Downloading https://pecl.php.net/get/redis-5.3.4.tgz via curl extension
[==================================================================] 261.87/261.87KB 100%
===> Extracting to /Users/YOUR_USER_NAME/.phpbrew/build/php-7.4.13/ext...
===> Installing redis extension...
Log stored at: /Users/YOUR_USER_NAME/.phpbrew/build/php-7.4.13/ext/redis/build.log
Changing directory to /Users/YOUR_USER_NAME/.phpbrew/build/php-7.4.13/ext/redis
===> Phpize...
===> Configuring...
===> Building...
===> Running make all: /usr/bin/make -C '/Users/YOUR_USER_NAME/.phpbrew/build/php-7.4.13/ext/redis' 'all'  >> '/Users/YOUR_USER_NAME/.phpbrew/build/php-7.4.13/ext/redis/build.log' 2>&1
===> Installing...
===> Running make install: /usr/bin/make -C '/Users/YOUR_USER_NAME/.phpbrew/build/php-7.4.13/ext/redis' 'install'  >> '/Users/YOUR_USER_NAME/.phpbrew/build/php-7.4.13/ext/redis/build.log' 2>&1
===> Extension is installed.
===> Creating config file /Users/YOUR_USER_NAME/.phpbrew/php/php-7.4.13/var/db/redis.ini.disabled
===> Enabling extension redis
[*] redis extension is enabled.
Done.
$ phpbrew ext |grep redis
 [*] redis        5.3.4

3. iniの場所

$ head ~/.phpbrew/php/php-7.4.13/var/db/redis.ini
extension=redis.so