r/PHPhelp • u/Tex_Betts • May 23 '22
Kreait php realtime database cannot get reference!! (cURL 60 error).
/r/Firebase/comments/uvqaz3/kreait_php_realtime_database_cannot_get_reference/
1
Upvotes
r/PHPhelp • u/Tex_Betts • May 23 '22
1
u/HolyGonzo May 23 '22
cURL error code 60 refers to being unable to validate the remote certificate. In most cases, remote certificates can be validated as long as you have a good CA bundle.
Go to the cURL official site and download the latest cacert.pem file. It's linked near the top of this page:
https://curl.se/docs/caextract.html
Save it into your PHP folder (the same folder containing your php.ini file). Technically, you can save it anywhere, but the PHP folder is a pretty good place for it.
Edit your php.ini file and set curl.cainfo to that cacert.pem file (including the full path).
Restart the PHP server.
As long as the remote server is using a valid certificate issued by a well-known CA, the above steps should fix that cURL error. If it's invalid or if it's self-signed or something, that requires different steps.