Error message: file_get_contents(): SSL operation failed with code 1. OpenSSL error messages: error: 14090086: SSL routes: ssl3_get_server_certificate: certificate verify failed
Blogger's application works: the file_get_contents used by the light navigation theme get the website weight value. Today, I encountered a problem, which the blogger has never seen or understood. After today's problem, I checked for a long time and found no solution. I found a blogger in the blog park had posted similar articles, and after reading it, I solved the problem. Now I will share the code, The partners copied themselves when encountering this problem.
Original code
$url=file_get_contents ("url link");
After modification
$arrContextOptions=array( "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ), ); $url=file_get_contents ("url link", false, stream_context_create ($arrContextOptions));
The blogger does not understand the OpenSSL problem, but after copying the code, the problem was really solved, and it was only shared for recording. If the gods have a better solution, you can share it in the comment area!
Text label: OpenSSL file_get_contents
A little Jack https://lkba.cn
The blogger focuses on Z-Blog website construction, website optimization, computer troubleshooting, reinstallation, optimization, maintenance system, etc., QQ/WX: 2126245521 (please specify the purpose)
Copyright © 2020-2023 Jack's works Reserved.
Powered By Z-Blog Sitemap | Shu ICP Bei No. 2023025269 - 1
Processed : 0.049 SQL : 14