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

Help me integrate #463

Closed
omidsolo opened this issue Jun 26, 2021 · 1 comment
Closed

Help me integrate #463

omidsolo opened this issue Jun 26, 2021 · 1 comment

Comments

@omidsolo
Copy link

Hey all,
I'm showing reCaptcha on my web form:

<script src="https://www.google.com/recaptcha/api.js" async defer></script>

I just can't read the value, I've uploaded the PHP files to my server but:

PHP Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home2/admin/public_html/site.com/ReCaptcha/ReCaptcha/RequestMethod/Post.php on line 80
PHP Warning: file_get_contents(https://www.google.com/recaptcha/api/siteverify): failed to open stream: no suitable wrapper could be found in /home2/admin/public_html/site.com/ReCaptcha/ReCaptcha/RequestMethod/Post.php on line 80

Any advise? I'm not PHP developer so can't debug it :(

@rowan-m
Copy link
Contributor

rowan-m commented Oct 4, 2021

According to the error message, this setting in your PHP configuration is disabled: https://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen

There are a number of things to investigate here, though apologies as this is quite developer focused advice. If it doesn't make sense, it would be worthwhile contacting whoever provides your PHP environment to see what they can do.

  • Check and upgrade your PHP version.
  • See if you can enable the setting in your PHP configuration
  • Try running with some of the other request methods, e.g.
$recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\Curl());
$resp = $recaptcha->setExpectedHostname('recaptcha-demo.appspot.com')
                  ->verify($gRecaptchaResponse, $remoteIp);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants