reCAPTCHA (Zend_Service_ReCaptcha) 抛出“无法连接到 tcp://api-verify.recaptcha.net:80”

发布于 2024-09-11 10:58:46 字数 1571 浏览 3 评论 0原文

我在 此页面 上使用 reCAPTCHA,但是当我提交时,我的 apache 日志中出现以下错误: 在我将 ssl 设置为 true 后,这种情况开始发生(我必须使用它,因为网站是 SSL)

[Wed Jul 28 18:47:54 2010] [error] [client XX31.80] PHP 致命错误:未捕获的异常“Zend_Http_Client_Adapter_Exception”,消息“无法连接到 tcp://api-verify.recaptcha.net:80”。错误#110:连接在 /XXX/local/XXX-php-XXX/library/Zend/Http/Client/Adapter/Socket.php:235\nStack trace:\n#0 /XXX/ 中长时间处于非活动状态local/XXX-php-XXX/library/Zend/Http/Client.php(976): Zend_Http_Client_Adapter_Socket->connect('api-verify.reca...', 80, false)\n#1 /usr/local /XXX-php-XXX/library/Zend/Service/ReCaptcha.php(487): Zend_Http_Client->request('POST')\n#2 /usr/XXX/XXX-php-XXX/library/Zend/Service /ReCaptcha.php(502): Zend_Service_ReCaptcha->_post('03AHJ_Vuuj0ZWOY...', '适配器')\n#3 /XXX/XXX/XXX-php-XXX/XXX/registration.php(111): Zend_Service_ReCaptcha->verify('03AHJ_Vuuj0ZWOY...', '适配器')\n#4 {main}\n 抛出 /XXX/local/XXX-php-XXX/library/Zend/Http/Client/Adapter/ Socket.php 第 235 行,参考:https://forum.esfcr.cz/registration.htm

有人知道发生了什么吗?如您所见,我正在使用 SSL。 我的 PHP 代码是:

$recpatcha = new Zend_Service_ReCaptcha(
                '6LdXXXXXXXXXXXXX9uy_D6rKXXXq9eM',
                '6LdXXXXXXXXXXXXXXXXXXXXndQ5X9ny',
                array('ssl' => true),
                array ('theme' => 'white', 'timeout' => 800));

和 $POST 处理:

$resp = $recpatcha->verify($_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);

谢谢

I am using reCAPTCHA on this page but when I submit I get following error in my apache log:
This started happening after I set ssl to true (i have to use it, becouse website is SSL)

[Wed Jul 28 18:47:54 2010] [error] [client X.X.31.80] PHP Fatal error: Uncaught exception 'Zend_Http_Client_Adapter_Exception' with message 'Unable to Connect to tcp://api-verify.recaptcha.net:80. Error #110: Connection was inactive for a long time' in /XXX/local/XXX-php-XXX/library/Zend/Http/Client/Adapter/Socket.php:235\nStack trace:\n#0 /XXX/local/XXX-php-XXX/library/Zend/Http/Client.php(976): Zend_Http_Client_Adapter_Socket->connect('api-verify.reca...', 80, false)\n#1 /usr/local/XXX-php-XXX/library/Zend/Service/ReCaptcha.php(487): Zend_Http_Client->request('POST')\n#2 /usr/XXX/XXX-php-XXX/library/Zend/Service/ReCaptcha.php(502): Zend_Service_ReCaptcha->_post('03AHJ_Vuuj0ZWOY...', 'adaptors of')\n#3 /XXX/XXX/XXX-php-XXX/XXX/registration.php(111): Zend_Service_ReCaptcha->verify('03AHJ_Vuuj0ZWOY...', 'adaptors of')\n#4 {main}\n thrown in /XXX/local/XXX-php-XXX/library/Zend/Http/Client/Adapter/Socket.php on line 235, referer: https://forum.esfcr.cz/registration.htm

Anyone who knows what is happening? As you see, I am using SSL.
My PHP code is:

$recpatcha = new Zend_Service_ReCaptcha(
                '6LdXXXXXXXXXXXXX9uy_D6rKXXXq9eM',
                '6LdXXXXXXXXXXXXXXXXXXXXndQ5X9ny',
                array('ssl' => true),
                array ('theme' => 'white', 'timeout' => 800));

and $POST processing:

$resp = $recpatcha->verify($_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

总以为 2024-09-18 10:58:46

我找到了解决方案。
问题出在防火墙上,它阻止传出连接。

I found solution.
Problem was in firewall, which blocks outgoing connections.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文