Mac 安装php扩展redis

PHP 安装 Redis 扩展:Connection to `ssl://pecl.php.net:443′ failed

1. 获取证书存储地址

php -r "print_r(openssl_get_cert_locations());"

执行结果

php -r "print_r(openssl_get_cert_locations());"
Array
(
    [default_cert_file] => /usr/local/etc/openssl@1.1/cert.pem
    [default_cert_file_env] => SSL_CERT_FILE
    [default_cert_dir] => /usr/local/etc/openssl@1.1/certs
    [default_cert_dir_env] => SSL_CERT_DIR
    [default_private_dir] => /usr/local/etc/openssl@1.1/private
    [default_default_cert_area] => /usr/local/etc/openssl@1.1
    [ini_cafile] => /usr/local/etc/openssl@1.1/cert.pem
    [ini_capath] => /usr/local/etc/openssl@1.1/certs
)

本地证书地址为 /usr/local/etc/openssl@1.1/cert.pem

2. 下载最新的证书

wget http://curl.haxx.se/ca/cacert.pem

3. 更新证书

sudo mv cacert.pem /usr/local/etc/openssl@1.1/cert.pem

4. 再次安装 redis 扩展

sudo pecl install redis

5. 遇到的坑

有可能会报错无法下载扩展文件,此时打开翻墙工具即 VPN 即可

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页