SSL issue after pear channel-update pear.php.net

安稳与你 提交于 2019-12-12 07:19:10

问题


I have XAMPP on Windows7. after update the pear.php.net channel with:

pear channel-update pear.php.net

and try for installing new packages, for example pecl install zmq , encountered with following message and can not install any package:

Connection to 'ssl://pecl.php.net:443' failed: Unable to find the socket 
transport "ssl" - did you forget to enable it when you configured PHP?

I very searched in net and tried to solve it but cannot resolve it. can anyone help me for resolve that and what is the reason?


回答1:


recently I faced this issue with macOS Sierra with XAMPP 7.0

I updated pecl channel wiht

sudo pecl channel-update pecl.php.net

and then I was getting

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

My solution is as below

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

check default_cert_file path

then download certificate from http://curl.haxx.se/ca/cacert.pem rename it and place it at default_cert_file path

then try pecl list-all

it should work fine




回答2:


This is a bug that happens in combination of PEAR 1.9.x with PHP 5.5+.

Please upgrade to PEAR 1.10.0dev1 (or the latest 1.10.0dev2) which fixes this issue.




回答3:


In my mac, and based of chintan reply, I did it:

/Applications/XAMPP/bin/php -r "print_r(openssl_get_cert_locations());"

... to show the default_cert_file

Array
(
    [default_cert_file] => /Applications/XAMPP/xamppfiles/share/openssl/cert.pem
    [default_cert_file_env] => SSL_CERT_FILE
    [default_cert_dir] => /Applications/XAMPP/xamppfiles/share/openssl/certs
    [default_cert_dir_env] => SSL_CERT_DIR
    [default_private_dir] => /Applications/XAMPP/xamppfiles/share/openssl/private
    [default_default_cert_area] => /Applications/XAMPP/xamppfiles/share/openssl
    [ini_cafile] => /Applications/XAMPP/xamppfiles/share/curl/curl-ca-bundle.crt
    [ini_capath] => 
)

Then a get the last version of cacert.pem:

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

And then I moved it to the correct place of default_cert_file:

sudo mv cacert.pem /Applications/XAMPP/xamppfiles/share/openssl/cert.pem



回答4:


In XAMPP 7.1 on Windows .bat-files of PECL and PEAR may be reason way SSL not work. If in place command php peclcmd.php list-all work for you, then this may because you use correct php.ini file. Just add option -c "%PHP_PEAR_BIN_DIR%\php.ini" to in .bat-file command (your php.ini may be in another path). It's hold be in :RUN section.



来源:https://stackoverflow.com/questions/31842400/ssl-issue-after-pear-channel-update-pear-php-net

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!