Since your URL includes special character &, file_get_contents() isn’t opening the URL. Please use urlencode() before passing the URL and check if it works. Do tell us if the problem persists.
I tried that. My concern is that, it is working everyday until few days ago without any change in code. So I was wondering why it is giving error all of sudden and what changed.
Yes, I was already using $_POST['g-recaptcha-response'] in place of ‘mysitekey’. Sorry, I must have typed like that in the question above.
Like I said, it was working fine earlier and all of a sudden started giving error.
Based on my understanding, it looks like the page could not be found as mentioned in the url. But, when I took and executed the url in separate browser tab, it was giving me the response correctly.
Tried that code in the article you have sent, but it is not working either. Looks like the the PHP version upgrade may have been causing the issue. Not sure. My smtp mail is also not working after that upgrade.
Further debugging and researching lead me to here. Apparently, the ssl certificate verification is failing and not sure why. Because I have ssl enabled from CloudFlare and it shows that my web site is secured.