Comments (90)
Here is my patched version of the recaptchalib.php
Original comment by [email protected]
on 28 Oct 2008 at 9:10
Attachments:
from recaptcha.
Why can't fedora 9 handle fsockopen correctly, that seems extremely broken.
Original comment by ben.maurer
on 28 Oct 2008 at 2:57
from recaptcha.
[deleted comment]
from recaptcha.
It does it on my CentOS 5.2 (32bit) testing server too, and I installed the LAMP
stack from source (as the yum versions are so old!). Seems to either be a
redhat or
php bug, I have googled it but not seen any answers.
Original comment by [email protected]
on 28 Oct 2008 at 4:53
from recaptcha.
Thank you, this fix has been implemented into WP-reCAPTCHA and will be in the
next
release.
Original comment by [email protected]
on 7 Nov 2008 at 11:40
from recaptcha.
This fix can be dangerous because it does a dns resolution on every page view.
Original comment by ben.maurer
on 8 Nov 2008 at 12:27
from recaptcha.
Dangerous?
I suppose it would be more efficient to only run the "gethostbyaddr()" just
before it
is used by fsockopen in the function, but for simplicity I just altered the
Constant
as it is at the top of the file.
Original comment by [email protected]
on 9 Nov 2008 at 8:52
from recaptcha.
How about in recaptcha_check_answer, right before the call to
_recaptcha_http_post,
which is the function that calls fsockopen. This way it would only be called
when it
needs to check the answer right?
define("RECAPTCHA_VERIFY_SERVER", gethostbyname('api-verify.recaptcha.net'));
$response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/verify",
Original comment by [email protected]
on 9 Nov 2008 at 9:42
from recaptcha.
Er, in that case I should just make it:
$response = _recaptcha_http_post (gethostbyname('api-verify.recaptcha.net'),
"/verify",
Does that seem fine?
Original comment by [email protected]
on 9 Nov 2008 at 9:43
from recaptcha.
I tested the suggested fix but it still doesn't work. My site is hosted on
aplusnet
bussines hosting plan, but on my local machine everything works perfect.
Original comment by [email protected]
on 29 Jan 2009 at 10:05
from recaptcha.
This fix doesn't work for me either. Always getting "Could not open socket"
error.
Original comment by [email protected]
on 4 Feb 2009 at 12:20
from recaptcha.
Hi All,
I'm getting the same error... I have tried the fix, but it doesn't work...
any siggestion???
thanks all
vit
Original comment by [email protected]
on 23 Jun 2009 at 5:23
from recaptcha.
it fixed the issue for me
Original comment by [email protected]
on 14 Jul 2009 at 6:08
from recaptcha.
I have tried that repatched version and I still get the 'could not open socket'
error.
Original comment by [email protected]
on 16 Jul 2009 at 6:19
from recaptcha.
Using the mediawiki plugin, fix doesn't work for me either...
Original comment by krakout
on 2 Sep 2009 at 8:32
from recaptcha.
I'm wondering if the server was offline. I just tried this fix and it worked.
Just
for kicks and grins, I changed the code back to the original and it still
worked. I'm
looking at coincidence.
I also found other threads where people changed their keys, which seemed to
work for
some of them. Probably a timing thing. If the server came back on while you were
making your change, you met with success.
Original comment by [email protected]
on 29 Oct 2009 at 10:09
from recaptcha.
I changed my lib to allow the user to continue if the script could not connect.
A
more secure solution would probably be to provide an alternate validation scheme
perhaps by setting $recaptcha_response->is_valid = alternate and checking for
that in
the page script.
Line 80 is now:
/*die ('Could not open socket - reCaptcha');*/ return 'socket error';
Line 184... I wrapped the solution and existing code in an if-else:
if ($response == 'socket error')
{
$recaptcha_response->is_valid = true;
}
else
{
$answers = explode ("\n", $response [1]);
$recaptcha_response = new ReCaptchaResponse();
if (trim ($answers [0]) == 'true') {
$recaptcha_response->is_valid = true;
}
else {
$recaptcha_response->is_valid = false;
$recaptcha_response->error = $answers [1];
}
}
Original comment by [email protected]
on 29 Oct 2009 at 10:52
from recaptcha.
fix didn't work for me too... Still getting the error
Original comment by [email protected]
on 25 Jun 2010 at 5:53
from recaptcha.
[deleted comment]
from recaptcha.
The reCAPTCHA wasn't entered correctly. Go back and try it again.(reCAPTCHA
said: incorrect-captcha-sol)
Original comment by [email protected]
on 30 Jul 2010 at 5:56
from recaptcha.
Looks like nobody cud solve this damn problem...... i ve tried all the
suggestions to the same result..... "Could not open socket"
Original comment by [email protected]
on 3 Aug 2010 at 10:17
from recaptcha.
Can anybody update how to check if fsockopen() is working or not??
Original comment by [email protected]
on 3 Aug 2010 at 10:19
from recaptcha.
Are you guys behind a proxy server?
Original comment by [email protected]
on 6 Aug 2010 at 8:54
from recaptcha.
Im having the same problem on an ubuntu 10.04 LAMP and reCaptcha PHP plugin
install.
Ive tried a couple of fixes from above and the problem is still there. Using a
dedicated server from a respectable web hosting company.
The weird thing is, sometimes the errors pops-up, sometimes it doesn't. If the
error pops-up, and try again, there's a chance it'll work. I guess it's about
50/50 each time the script is ran.
Original comment by [email protected]
on 7 Aug 2010 at 11:43
from recaptcha.
google, i'll clap your asses!, i've lost 2 hours of my life screwing this
captcha, and it's same socket error...Shame on you!
Original comment by [email protected]
on 13 Aug 2010 at 4:37
from recaptcha.
Am on centos 5.5 and its private domain and I still have the issue with latest
2.9.7. Could someone help..
Original comment by [email protected]
on 15 Aug 2010 at 5:10
from recaptcha.
Same problem here on Debian Lenny, up to date system, latest library.
Original comment by [email protected]
on 16 Aug 2010 at 8:54
from recaptcha.
you guys are using the plugin downloaded from this website? It's outdated, you
should be using the one from here:
http://wordpress.org/extend/plugins/wp-recaptcha/
Original comment by [email protected]
on 16 Aug 2010 at 9:03
from recaptcha.
The source code of comment 28 looks like a spammer/obscure download. Google,
where is the fix for the original version?
Original comment by [email protected]
on 20 Aug 2010 at 9:09
from recaptcha.
I'm having the same issue.
Google or ReCaptcha people. Any clue?
Debian GNU/Linux 5.0 here.
I've tried all of the above solutions, but none gave the optimal result.
Thanks in advance!!
Original comment by [email protected]
on 22 Aug 2010 at 12:36
from recaptcha.
Solved this problem by applying the patch, then linking /etc/resolv.conf to
/etc/httpd/etc/resolv.conf (in fedora) and /etc/apache2/etc/resolv.conf (in
ubuntu...), then restarting apache....
Original comment by [email protected]
on 8 Sep 2010 at 5:02
from recaptcha.
It seems i am screwed!
Original comment by [email protected]
on 6 Oct 2010 at 10:54
from recaptcha.
Although it's been working flawlessly for more than a year, this issue suddenly
appeared... why ?
I really don't know how to solve this because I didn't modify anything in PHP
config. I've also tried fix from #1 without success.
Lawrence, did you get the issue suddenly like I did too or it never worked
before ?
Original comment by [email protected]
on 19 Oct 2010 at 8:31
from recaptcha.
[deleted comment]
from recaptcha.
I found a fix to recaptchalib.php v1.11
-in this line:
define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
-replace "www.google.com" with it's IP address.
define("RECAPTCHA_VERIFY_SERVER", "173.194.36.104");
Try to look for the IP address yourself if this one don't work, I'm not sure if
its the same at different locations(?).
Original comment by [email protected]
on 11 Nov 2010 at 6:56
from recaptcha.
Make sure it isn't the server which is blocking it, I tried all different kinds
of solutions but couldn't get it to work, then simply uploaded it onto another
host, and it worked perfectly.
And use the latest version with
define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
works like a charm
Good luck
Original comment by [email protected]
on 12 Nov 2010 at 12:36
from recaptcha.
I had the same issue. Strangely I solved it by closing the php code after
recaptha section, then immediately reopening it!
Original comment by [email protected]
on 28 Nov 2010 at 12:23
from recaptcha.
actually the problem is back now
Original comment by [email protected]
on 29 Nov 2010 at 6:26
from recaptcha.
I used recaptcha last week for first time and was okay..
but now, get the same problem
Original comment by [email protected]
on 22 Dec 2010 at 6:53
from recaptcha.
"Could not open socket" does anyone has the answer for this issue?
Original comment by [email protected]
on 22 Dec 2010 at 7:16
from recaptcha.
I use the server of name: 000webspace.com, this server shows me the message
"Could not open socket. " I do not know. but maybe in the server configuration
can be done, but on my computer "appserv" seems all well and good
Original comment by [email protected]
on 27 Dec 2010 at 5:34
from recaptcha.
I use the server of name: 000webspace.com, this server shows me the message
"Could not open socket. " I do not know. but maybe in the server configuration
can be done, but on my computer "appserv" seems all well and good
Original comment by [email protected]
on 27 Dec 2010 at 5:35
from recaptcha.
I think those of us on shared hosting may get this problem because the host
server admin is not allowing us to open sockets. I am using Zymic. There
servers don't allow you to use sockets - so ReCaptcha is not a suitable
solution :(
Original comment by [email protected]
on 1 Jan 2011 at 10:09
from recaptcha.
Any fix for this? cause i STILL have this problem... :(
Original comment by [email protected]
on 4 Jan 2011 at 8:17
from recaptcha.
For several months reCaptcha is running smoothly and since yesterday I get a
sudden the message "Could not open socket." Does anyone have a solution?
Original comment by [email protected]
on 6 Jan 2011 at 2:13
from recaptcha.
Me too. It's been has been fine for the last few months and then today it
started happening again. http://commentwars.org/register
Original comment by [email protected]
on 7 Jan 2011 at 7:12
from recaptcha.
[deleted comment]
from recaptcha.
It's not programming problem.
You have to ask network admin..
They have to open port :80
Original comment by [email protected]
on 10 Feb 2011 at 12:26
from recaptcha.
I've seen this port 80 thing mentioned on other forums.
I don't think so.
In my Fedora Core 13 system, I went so far as to take the firewall completely
down and I still get the "Could not open socket".
This problem cropped up on system that was essentially running several months
untouched.
From what I can tell, the problem comes from the system not being able to
resolve a host name (wouldn't it be cool if the error message said that?).
That can happen for a lot of reasons...
Original comment by [email protected]
on 23 Mar 2011 at 3:36
from recaptcha.
I'm using recaptcha-form.1.2.zip downloaded from
http://wordpress.org/extend/plugins/recaptcha-form/ and i'm getting the same
error. I try to use the fix, but doesn't works for me. It's not seem to be a
resolution problem...
Any solutions or new notice this issue?
Original comment by [email protected]
on 16 May 2011 at 6:41
from recaptcha.
No solution. Me in the first half of the day got error and in the second half
works fine with the same code. Seems google it self can help us.
Original comment by [email protected]
on 16 Jul 2011 at 9:07
from recaptcha.
We implemented ASL Security with mod_security and seemed to cause the issue so
we are looking to see if there is a resolution there.
Original comment by [email protected]
on 25 Jul 2011 at 5:58
from recaptcha.
I'm facing this same issue.. :/ could not open socket... Even with the fix.
I think google has abandoned recaptcha...
Big 404 here:
http://recaptcha.net/plugins/php/
Original comment by [email protected]
on 31 Jul 2011 at 5:11
from recaptcha.
@all: your web hosting must support php fsock function to do this . .
# sorry if my english is bad , i'm from west-borneo (indonesia) . . :)
Original comment by [email protected]
on 4 Aug 2011 at 3:03
from recaptcha.
Eish same here
Original comment by [email protected]
on 15 Aug 2011 at 11:58
from recaptcha.
Eish same here, Could not open socket
Original comment by [email protected]
on 15 Aug 2011 at 11:59
from recaptcha.
If this works on your local machine and not on you host domain then ask your
host admin to open the port:80.
Original comment by [email protected]
on 14 Oct 2011 at 1:51
from recaptcha.
Comment 17 by [email protected], Oct 29, 2009
------
Slightly modifying B Taylor's solution did the trick for me, it's not perfect
but it's good enough and won't trigger any warning:
$recaptcha_response = new ReCaptchaResponse();
if ($response == 'socket error') {
$recaptcha_response->is_valid = true;
} else {
$answers = explode ("\n", $response [1]);
if (trim ($answers [0]) == 'true') {
$recaptcha_response->is_valid = true;
} else {
$recaptcha_response->is_valid = false;
$recaptcha_response->error = $answers [1];
}
}
return $recaptcha_response;
Original comment by [email protected]
on 20 Oct 2011 at 1:49
from recaptcha.
Please, why am i getting this error:
Image Verification failed!. Go back and try again.
(reCAPTCHA said: )
josephbupe
Original comment by [email protected]
on 17 Dec 2011 at 2:17
from recaptcha.
no, this fix doesnt work, it doesnt verify the correct letters given and gives
error to re-enter them corectly. :(
Original comment by [email protected]
on 6 Mar 2012 at 10:38
from recaptcha.
I found the fix...
plz update ur recaptchalib.php from here
it works now :)
Original comment by [email protected]
on 6 Mar 2012 at 11:05
from recaptcha.
No, it still does not work. I've tried both downloading the newest lib, and
making the suggested changes to it, but without success.
Original comment by [email protected]
on 8 Mar 2012 at 8:31
from recaptcha.
Actually, it does work from a different host. Must be some kind of network
infrastructure problem @ the host.
Original comment by [email protected]
on 8 Mar 2012 at 10:19
from recaptcha.
Has any recent progress been made against this issue? I'm still experiencing
this problem after updating my lib to v1.11 and updating my public and private
keys for my domain.
Original comment by [email protected]
on 29 Apr 2012 at 11:51
from recaptcha.
aqui la solución... Here the solution.. ;-)
http://hellowahab.wordpress.com/2012/02/15/recaptcha-cannot-connect-to-host-prob
lem-behind-a-proxy/
Original comment by [email protected]
on 8 May 2012 at 7:48
from recaptcha.
replace----> define("RECAPTCHA_VERIFY_SERVER", "www.google.com"); to this
define("RECAPTCHA_VERIFY_SERVER", "74.125.236.178");
worked on Linux fedora 17
Original comment by [email protected]
on 15 Jun 2012 at 12:42
from recaptcha.
What happens when/if Google changes their IP. You will have to change the code
on each site you've made this fix to?
Original comment by [email protected]
on 20 Jun 2012 at 9:41
from recaptcha.
yes you're correct.i'm thinking this not a PHP problem or RECAPTCHA lib
problem.something with OS or DNS problem i'm don't know much about it. if
Google not changes their IP this fix should not be a problem.you can replace
the modified RECAPTCHA lib on each site.
Original comment by [email protected]
on 23 Jun 2012 at 10:46
from recaptcha.
I was facing the same issue today. but i had solved my problem after i contact
to my network administrator.
It is possible that you do not have direct access to port 80 as a organisation
in which you are working has set up a proxy using a firewall system. so please
contact your administrator before saying anything to google as we all depends
on it.. :)
port 80 is used in function "_recaptcha_http_post" in recapchalib.php and the
error of socket occurs on line 80 "@fsockopen" function.
I am using recaptcha on my localhost and it works fine for me. hope contacting
to your network administrator or removing any kind of proxy from your server
work for you all.
Have a nice day...
Original comment by [email protected]
on 20 Jul 2012 at 9:41
from recaptcha.
I am using WHMCS software and upon implementing recaptcha (comes included - as
an option) it displays, but when I submit the form, it shows the following:
reCAPTCHA Error: Could not open socket
What's worse, the library is obfuscated with ionCube (probably something they
did to it and don't want it to be messed with). I am running a godaddy economy
reseller account that is running CENTOS 6.2 x86_64, PHP v5.3. Not sure why this
is acting up.
Original comment by [email protected]
on 21 Aug 2012 at 3:39
from recaptcha.
The comment 66 resolved for me.
"
replace----> define("RECAPTCHA_VERIFY_SERVER", "www.google.com"); to this
define("RECAPTCHA_VERIFY_SERVER", "74.125.236.178");
"
Original comment by [email protected]
on 17 Nov 2012 at 7:36
from recaptcha.
[deleted comment]
from recaptcha.
[deleted comment]
from recaptcha.
Hello I Read all the post!! Is there an other URL for
RECAPTCHA_VERIFY_SERVER??? Cuz I get the Same Error: Could not open socket. I
try everything!!! Y check it my configuration php.ini and mi allow_url_fopen
its on!! and I try with gethostbyname()and failing too...
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.236.178");
This is a fragment of my library!! please help me!!!
Original comment by [email protected]
on 21 Feb 2013 at 8:25
from recaptcha.
I have the same problem than AL10529...
Original comment by [email protected]
on 4 Mar 2013 at 3:56
from recaptcha.
what is this
Original comment by [email protected]
on 13 Mar 2013 at 1:28
from recaptcha.
I had this problem, it turned out my dedicated ubuntu 12.10 box was not
preforming dns lookups.
Anyone that has this issue within on ubuntu / or similar distro check this :
Terminal : ping -c 4 google.com
if it replys -> ping: unknown host google.com
it means your name servers and resolv.conf isnt correct and you need to
reconfigure it.
Edit this file :
/etc/resolv.conf || /etc/resolvconf/resolv.conf.d/head
# Google's...
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 127.0.0.1 # For my own domains on the machine.
then once done reconfigure the resolvconf via :
sudo dpkg-reconfigure resolvconf
then reboot the server via your host manager || power || sudo reboot
Then once back on the terminal check again that pinging google works.
Also note some hosting providers probably wont allow you to preform lookups /
create sockets.
Original comment by [email protected]
on 21 Mar 2013 at 12:59
from recaptcha.
Changing the verify line in the recaptchalib.php file worked for me.
as suggested above:
define("RECAPTCHA_VERIFY_SERVER", "74.125.236.178");
Original comment by [email protected]
on 18 Apr 2013 at 5:04
from recaptcha.
i am having same issue "could not open socket", how to solve this :(
Original comment by [email protected]
on 1 Aug 2013 at 9:20
from recaptcha.
Comments 66 and 78, worked for me, thanks guys!
Original comment by [email protected]
on 5 Aug 2013 at 6:14
from recaptcha.
Not working Properly. e.g. if captcha code is given "abc def" and we are
entering " abc defgh", then it does not show any error and if we enter "abc de"
then also same issue is there.
Original comment by [email protected]
on 16 Aug 2013 at 8:52
from recaptcha.
doesnt work on me either. This is only i get "The reCAPTCHA wasn't entered
correctly. Go back and try it again.(reCAPTCHA said: )" No error message or
success message
Original comment by [email protected]
on 4 Sep 2013 at 8:43
from recaptcha.
I use @pfsockopen instead of @fsockopen in recaptchalib.php and problem solved
Original comment by [email protected]
on 15 Sep 2013 at 2:03
from recaptcha.
Comments 83, worked for me, thanks guys!
Original comment by [email protected]
on 22 Oct 2013 at 10:41
from recaptcha.
i use all the solution here, but still i have error. "Could not open socket".
help please :(
Original comment by [email protected]
on 5 Dec 2013 at 2:40
from recaptcha.
I too used all solutions and nothing worked. Now I am requesting hosting
provider to open port 80. Hope that helps.
Original comment by [email protected]
on 9 Jan 2014 at 11:12
from recaptcha.
comment #35 worked for me:
"-in this line:
define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
-replace "www.google.com" with it's IP address.
define("RECAPTCHA_VERIFY_SERVER", "173.194.36.104");"
Thanks!
Original comment by [email protected]
on 6 Feb 2014 at 5:22
from recaptcha.
[deleted comment]
from recaptcha.
for those getting the "Go back and try again" message ... find the latest
recaptchalib.php here http://code.google.com/p/recaptcha/ and then make the ip
address change as outlined above
Original comment by [email protected]
on 16 Jul 2014 at 5:51
from recaptcha.
Funcionó correctamente en Joomla 2.5.4 luego de las siguientes modificaciones:
1) En Código: /public_html/plugins/captcha/recaptcha/recaptcha.php
a) Línea 24+-: const RECAPTCHA_API_SERVER = "http://api.recaptcha.net";
REEMPLAZADA POR:
const RECAPTCHA_API_SERVER = "http://www.google.com/recaptcha/api";
Línea 25+-: const RECAPTCHA_API_SECURE_SERVER =
"https://www.google.com/recaptcha/api";
Línea 26+-: const RECAPTCHA_VERIFY_SERVER = "api-verify.recaptcha.net";
REEMPLAZADA POR:
const RECAPTCHA_VERIFY_SERVER = "www.google.com";
b) Línea 118 +-: $response =
$this->_recaptcha_http_post(self::RECAPTCHA_VERIFY_SERVER, "/verify",
REEMPLAZADA POR:
$response = $this->_recaptcha_http_post(self::RECAPTCHA_VERIFY_SERVER,
"/recaptcha/api/verify",
c) Línea 189 +-: if (($fs = @fsockopen($host, $port, $errno, $errstr, 10)) ==
false )
REEMPLAZADA POR:
if (($fs = @pfsockopen(gethostbyname($host), $port, $errno, $errstr, 10)) ==
false )
2) Parámetro PHP.ini: allow_url_fopen=On
Thanks!
Original comment by [email protected]
on 15 Aug 2014 at 12:00
from recaptcha.
Related Issues (20)
- A reCAPTCHA plugin for phpbb3 HOT 2
- .Net assembly is not strongly named HOT 2
- the https api si not fully consistent
- Python: allow options (theme, language, ...) HOT 1
- XHTML invalidity HOT 3
- Recaptcha implementation for web contact form written in C# HOT 1
- Recaptcha textbox is on the right side instead of on the left HOT 2
- Zip archive HOT 3
- Recaptcha not validating even when input is correct HOT 12
- Lack of Language Property in Recapcha for .Net HOT 1
- No unit test parameters in python library
- captcha.py: generate NOT WALID html-code (may be not secure for XSS-attack )
- Doesn't play well with back button on safari HOT 2
- recaptcha dissapears after submit HOT 2
- MediaWiki error: Parameter 1 to ReCaptcha::confirmEdit() expected to be a reference HOT 6
- ViewState MAC failed HOT 3
- recaptcha.js sometimes delivered as binary HOT 1
- recaptcha module for Twisted Python HOT 1
- Cannot load URL: api-verify.recaptcha.net HOT 8
- Recaptcha accepts incorrect answers/response. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recaptcha.