简体   繁体   中英

PHP Recaptcha Form only Works with IP Address instead of www.google.com

As mentioned in the title. My recaptcha form only works if I change this:

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

to this:

define("RECAPTCHA_VERIFY_SERVER", "74.125.236.178");

I am using myhosting.com vps linux server. Any idea why it doesn't work with www.google.com ?

Fix to this problem is,

//line 40 in recpatchalib.php and replace:
define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net");

// With this:
define("RECAPTCHA_VERIFY_SERVER", gethostbyname('api-verify.recaptcha.net'));

Try it.

Got from Issues page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM