ReCaptcha - Could not open socket

Deadly 提交于 2019-12-23 12:28:27

问题


Before I ask this question, let me mention I know there are several of the exact same questions on the site but I am afraid they can't help me out.

Hi,

Yesterday my ReCaptcha was working fine but now it's not. I am using the library provided by Google and using the proper code. I did not change any code since yesterday so it should still work. However, when I try to submit the form now the page returns Could not open socket.

Edit: I just checked and fsockopen is enabled on my server.


回答1:


I came into same issue, but all the alternative host names I googled already don't work. A very good advice that helped me was from Recaptcha google group

Use:

define("RECAPTCHA_VERIFY_SERVER", gethostbyname("www.google.com"))

Works just fine for me.




回答2:


Changed the following:

define("RECAPTCHA_VERIFY_SERVER", "www.google.com");

to

define("RECAPTCHA_VERIFY_SERVER", "74.125.227.48");

Now it works. This is to be edited in the captcha lib php file recaptchalib.php.




回答3:


Open your cmd and type: ping www.google.com The google server replay: Replay from xxx.xxx.xx.xxx ... take the ip

Edit your recaptchalib.php

At the line

define("RECAPTCHA_VERIFY_SERVER", "www.google.com");

replace the www.google.com with the google IP address

define("RECAPTCHA_VERIFY_SERVER", xxx.xxx.xxx.xxx);



来源:https://stackoverflow.com/questions/19055472/recaptcha-could-not-open-socket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!