redis扩展 下载地址 https://pecl.php.net/package/redis
$ tar -zxvf redis-5.3.4.tgz 解压redis扩展包
docker ps -a
##3.2 Copy the extension package to the PHP container
docker cp docker cp /docker/tool/redis-5.3.4 php:/usr/src/php/ext/redis # /docker/tool/redis-5.3.4 解压包的地址 # php: 容器ID获取容器名称 # /usr/src/php/ext/redis 容器内的地址
docker exec -it php bash #进入容器 cd /usr/src/php/ext/redis # 查看扩展是否复制进入容器中 docker-php-ext-install redi # 按转redis扩展 php --ri redis 或者 php -m # 查看redis是否安装成功
The above is the detailed content of How to install redis extension in docker php container. For more information, please follow other related articles on the PHP Chinese website!