Could Not Open Socket reCAPTCHA Error


The weirdest thing happened with Recaptcha, when I moved from shared hosting to a VPS with PHP 5.3.

I started to get could not open socket error on one of my sites, I searched and searched all over but couldn’t find the answer.

What was even more odd was that another site that I had on the same server worked fine.

After searching for about 6 hours, I finally found a solution.

All I did was change the following code in recaptchalib.php file.

First open the file and look for:

define(“RECAPTCHA_API_SERVER”, “http://www.google.com/recaptcha/api”);
define(“RECAPTCHA_API_SECURE_SERVER”, “https://www.google.com/recaptcha/api”);
define(“RECAPTCHA_VERIFY_SERVER”, “www.google.com”);

and change it to the following:

define(“RECAPTCHA_API_SERVER”, “http://www.google.com/recaptcha/api”);
define(“RECAPTCHA_API_SECURE_SERVER”, “https://www.google.com/recaptcha/api”);
define(“RECAPTCHA_VERIFY_SERVER”, “74.125.227.48”);

If you notice the only thing changed was www.google.com to and IP of google’s which I found to work was 74.125.227.48

Some suggested that globals should be turned on, but the site that was working properly had globals turn on, so it didn’t make any sense when I turned off globals and it still didn’t work.

This is the easiest and simplest way to fix this problem, no need to mess with php.ini and also .htcacces file.

I tried to even contact Recaptcha but wasn’t successful, and no way to contact them, plus they are now a part of Google, so it’s even harder to get in touch with someone.

If you have another solution, I’m open to suggestions.

 

 



Did you know that if you subscribe to our website, you will receive email notifications whenever content changes or new content is added.
1. Enter your e-mail address below and click the Sign Me Up button.
2. You will receive an email asking you to confirm your intention of subscribing to our site.
3. Click the link in the email to confirm. That’s all there is to it!

Enter your email address below to subscribe to Prison Break Freak.

Note: if you wish to unsubscribe from our site, click the unsubscribe link at the bottom of the email you received.
Then indicate you no longer wish to receive our emails.

Thank You
Prisonbreakfreak.com Team


Posted in IT Support.

Leave a Reply