Connection to `ssl://pecl.php.net:443' failed:

1. Run the following command in putty: 

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



2. It returns an array like this: 

Array 

    [default_cert_file] => /usr/local/apps/etc/openssl/cert.pem 
    [default_cert_file_env] => SSL_CERT_FILE 
    [default_cert_dir] => /usr/local/apps/etc/openssl/certs 
    [default_cert_dir_env] => SSL_CERT_DIR 
    [default_private_dir] => /usr/local/apps/etc/openssl/private 
    [default_default_cert_area] => /usr/local/apps/etc/openssl 
    [ini_cafile] => 
    [ini_capath] => 


3. Note that  /usr/local/apps/etc/openssl/cert.pem isn't present. Download a cUrl cert bundle , as suggested by this thread from Stackoverflow 

4. save the bundle in  '/usr/local/apps/etc/openssl/'  and rename it as 'cert.pem' 

Everything has been fixed. I thought it would be troublesome but turned out it was easy as pie~

posted @ 2018-09-06 15:57  阿拉善的樵夫  阅读(3210)  评论(0编辑  收藏  举报