Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid-json response #103

Closed
dianeensey opened this issue Apr 4, 2016 · 3 comments
Closed

invalid-json response #103

dianeensey opened this issue Apr 4, 2016 · 3 comments
Labels

Comments

@dianeensey
Copy link

I'm getting a response of invalid-json when I use the test example and the default send option (\ReCaptcha\ReCaptcha($secret)).

\ReCaptcha\RequestMethod\SocketPost() doesn't work on this server (error: Warning: fsockopen(): unable to connect to ssl://www.google.com:443 (Connection timed out)).

\ReCaptcha\RequestMethod\CurlPost() just runs and finally quits without a response from the server.

PHP 5.4.28
Linux server
I can post the info.php if needed.

@Brather
Copy link

Brather commented Mar 2, 2017

do it like this:

//$recaptcha = new \ReCaptcha\ReCaptcha($secret);
// If file_get_contents() is locked down on your PHP installation to disallow
// its use with URLs, then you can use the alternative request method instead.
// This makes use of fsockopen() instead.
$recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\SocketPost());

cheers

@ligiama
Copy link

ligiama commented Apr 20, 2017

Hi @Brather , i've tried it and it gives me error 500... any ideas??
thanks

@rowan-m
Copy link
Contributor

rowan-m commented Jul 29, 2018

Closing super old issues. Please re-raise if still relevant.

@rowan-m rowan-m closed this as completed Jul 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants