0

我在此页面上使用 reCAPTCHA,但是当我提交时,我的 apache 日志中出现以下错误:这在我将 ssl 设置为 true 后开始发生(我必须使用它,因为网站是 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

有谁知道发生了什么?如您所见,我使用的是 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"]);

谢谢

4

1 回答 1

1

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

于 2010-08-12T11:28:37.657 回答