Home > Backend Development > PHP Tutorial > FreeBSD php5.6 https fsockopen错误

FreeBSD php5.6 https fsockopen错误

WBOY
Release: 2016-06-23 13:26:07
Original
1371 people have browsed it

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());"
Copy after login

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] => )
Copy after login

ls /usr/local/openssl/cert.pem
Copy after login


根本没有这个文件,

做个软连接:

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

OK.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template