Captcha Not Working

Hi , i am using captcha in my Signup form. The problem is, it is not showing any image. it just show this text.

"Get a new code"

Clicking on the text gives me error

"Unable to resolve the request "captcha/refresh/1"

On page load it also generates error

"NetworkError: 404 Not Found - http://localhost/myapp/captcha/v/5253d1a155702"

i have checked, jquery is also loaded.

Here is my code for captcha.

Model: Users.php

class Users extends CActiveRecord


	public $verifyCode;

        public function rules(){

             return array(




Controller: UsersController

class UsersController extends Karmora


    public function accessRules()


        return array(


                'actions'=>array('create', 'captcha'),





    public function actions(){

    	return array(

    	// captcha action renders the CAPTCHA image displayed on the user registration page







View: Signup.php


//clearing captcha session values to get updated captcha image

	$session = Yii::app()->session;

	$prefixLen = strlen(CCaptchaAction::SESSION_VAR_PREFIX);

	foreach ($session->keys as $key) {

		if (strncmp(CCaptchaAction::SESSION_VAR_PREFIX, $key, $prefixLen) == 0)




		echo $form->labelEx($model,'verifyCode', array('class' => 'fieldname')); 

		echo $form->textField($model,'verifyCode');  ?>

		     <span class="captcha">			        	

		           <?php $unique_id = rand(0,9999);	?>

		           <?php $this->widget('CCaptcha', array('buttonOptions' => array('id' => $unique_id),'id'=>'image_captcha')); ?>

		           <?php echo $form->error($model,'verifyCode'); ?>	


	<?php endif; ?>

I am unable to understand why it is not wroking. please help me. :(

The captcha ulr should be User/captcha

How i can change this URL?

try this


I am not sure it’s work or not.

Not it is not working.

On page load it generate error

"404 Not Found - http://localhost/karmora/captcha/v/5253e81d29360"

it means that file is not found for captcha? i am also using Routing. is it possible that Routing is creating problem.


‘/Signup’ => ‘users/signup’,

The url where CCacthca tries to load the view is controlled by this property.

Check if a captcha url exitsts and if is the same searched by CCActptcha.