I'm trying to get the profile picture of this website but getting the error as below. I tried going to Plugins and replacing this code, but it didn't work
Link: https://vn.joboko.com/viec-lam-ky-su-he-thong-pacs-y-te-tai-ha-noi-xvi2125694
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
with
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
My Answer:
It seems like the issue is related to the SSL certificate not being recognized by cURL. Instead of disabling SSL verification, which is not recommended for security reasons, you can try to update the CA Root Certificates on your server.
You can download the latest CA Root Certificates from the cURL website (https://curl.haxx.se/docs/caextract.html) and then update your php.ini file to point to the location of the CA Root Certificates.
Add the following line to your php.ini file:
curl.cainfo = "path/to/cacert.pem"
Make sure to replace "path/to/cacert.pem" with the actual path to the CA Root Certificates file that you downloaded.
After updating the php.ini file, restart your web server for the changes to take effect. This should resolve the SSL certificate problem and allow cURL to make the request successfully.
Rate this post
5 of 5 based on 6697 votesComments