Hello,
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!