ReCaptcha connection-failed on server side verify - tried all RequestMethods


I configured contact-form PHP pages as kindly provided by InfinityFree via GitHub. It works as expected without ReCaptcha enabled. However if I enable ReCaptcha it works correctly on client side only - on server side I keep getting “connection-failed” error after trying all possible RequestMethods which are packaged as part of ReCaptcha lib (CurlPost, Post, SocketPost).

This leads me to believe (please correct me if I am wrong) that some required PHP setting is disabled. Would you be so kind to point me how I can configure the necessary PHP settings to allow ReCaptcha verify on server side?

Basically the lines below fail (I tried without RequestMethod explicit class (i.e. default) and using Post(), SocketPost() and CurlPost() with no luck)

$recaptcha = new \ReCaptcha\ReCaptcha(CONTACTFORM_RECAPTCHA_SECRET_KEY, new \ReCaptcha\RequestMethod\Post());
$resp = $recaptcha->verify($_POST[‘g-recaptcha-response’], $_SERVER[‘REMOTE_ADDR’]);
if (!$resp->isSuccess()) { ← this is not a success but “connection-failed” error

Thank you in advance!

As @PZWY18 discovered earlier today, there is an issue connecting with Google’s reCAPTCHA service right now. This issue also affects the contact form we made.

This issue will be fixed with a PHP upgrade next week. So until then, you could disable reCAPTCHA for now.


Thank you admin :smile:

Thank you very much for reply!

Wish I asked earlier as spent the whole day looking in the wrong place, but at least the fix is next week.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.