I get errors, when I upload the code on web server, with the php variable allow_url_fopen that is set 0 for prevent ddos attacks, I've tried using cURL instead of file_get_contents but my codes doesn't works, so I'm asking for help with that and I think that this problem occurred with other people.
Sorry for my bad english.
The alternative ReCaptcha\RequestMethod\SocketPost method should work for you here. You can use this by replacing this line:
$recaptcha = new \ReCaptcha\ReCaptcha($secret);
with this line:
$recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\SocketPost());
Can you put these detail into documentation, please? Not sooo "hidden" here in the queue...
// Try to workaround locked down web servers.
if (!ini_get('allow_url_fopen')) {
// allow_url_fopen = Off
$recaptcha = new \ReCaptcha\ReCaptcha($recaptcha_secret_key, new \ReCaptcha\RequestMethod\SocketPost());
}
else {
// allow_url_fopen = On
$recaptcha = new \ReCaptcha\ReCaptcha($recaptcha_secret_key);
}
_Please_ mention this in the README!
_Please_ mention this in the README!
yes ... please
I have looked an hour for a solution and could't find anything there.
Maybe a Troubleshoot section?
It's 2019, and I'm with you guys.
Most helpful comment
The alternative
ReCaptcha\RequestMethod\SocketPostmethod should work for you here. You can use this by replacing this line:with this line: