Zend framework i ReCaptcha

Muszę wstawić ReCaptcha w formie w mojej aplikacji ZF. Próbuję postępować zgodnie z oficjalną dokumentacją, ale usługa ReCaptcha zawsze zwraca błąd „niepoprawny-captcha-sol”. Kod, którego używam:

(W formie)

// configure the captcha service
$privateKey = 'XXXXXXXXXXXXXXXXXXX';
$publicKey = 'YYYYYYYYYYYYYYYYYYYY';
$recaptcha = new Zend_Service_ReCaptcha($publicKey, $privateKey);

// create the captcha control
$captcha = new Zend_Form_Element_Captcha('captcha',
                                array('captcha' => 'ReCaptcha',
                                      'captchaOptions' => array(
                                          'captcha' => 'ReCaptcha',
                                          'service' => $recaptcha)));

$this->addElement($captcha);

(W kontrolerze)

$recaptcha = new Zend_Service_ReCaptcha('YYYYYYYYYYYYY', 'XXXXXXXXXXXXXXX');

$result = $recaptcha->verify($this->_getParam('recaptcha_challenge_field'),
                             $this->_getParam('recaptcha_response_field'));

if (!$result->isValid()) {
    //ReCaptcha validation error
}

Jakaś pomoc proszę?

questionAnswers(2)

yourAnswerToTheQuestion