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/cert.pem
    [default_cert_file_env] => SSL_CERT_FILE
    [default_cert_dir] => /usr/local/etc/openssl/certs
    [default_cert_dir_env] => SSL_CERT_DIR
    [default_private_dir] => /usr/local/etc/openssl/private
    [default_default_cert_area] => /usr/local/etc/openssl
    [ini_cafile] =>
    [ini_capath] =>
)

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

2. 下载最新的证书

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

3. 更新证书

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

4. 再次安装 redis 扩展

sudo pecl install redis
联系我们

邮箱 626512443@qq.com
电话 18611320371(微信)
QQ群 235681453

Copyright © 2015-2024

备案号:京ICP备15003423号-3