码迷,mamicode.com
首页 > Web开发 > 详细

FreeBSD php5.6 https fsockopen错误

时间:2015-09-21 19:49:45      阅读:341      评论:0      收藏:0      [点我收藏+]

标签:

php升级到5.6后,fsockpen(‘ssl://www.baidu.com‘, 443, $errno, $errstr, 10);
爆出:

PHP Warning:  fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate 

获取 php加载的 openssl.pem文件路径:

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

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

ls /usr/local/openssl/cert.pem


根本没有这个文件,

做个软连接:

ln -s /usr/local/share/certs/ca-root-nss.crt /usr/local/openssl/cert.pem

OK.

FreeBSD php5.6 https fsockopen错误

标签:

原文地址:http://my.oschina.net/jsk/blog/509295

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!