a nother captcha NO IMAGE

I have tried to get the captcha image to show for a long time now… ived checked meny threads in this forum and i cant finde out the problem. Captcha image those show under Contact.

Any idees?

PHP Info:

DOM/XML enabled

DOM/XML API Version 20031129

libxml Version 2.7.3

HTML Support enabled

XPath Support enabled

XPointer Support enabled

Schema Support enabled

RelaxNG Support enabled

checkRequirements() returns true.

UserController




	public function accessRules()

	{

		return array(

			array('allow',  // allow all users to perform 'index' and 'view' actions

				'actions'=>array('index','view', 'create'),

				'users'=>array('*'),

			),

			

			array('allow', 

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

			'users' => array('*'),

			),



User Model




	public function rules()

	{

		// NOTE: you should only define rules for those attributes that

		// will receive user inputs.

	

		

		return array(

			array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),



View User _form




	<?php if(extension_loaded('gd')): ?>

	<div class="row">

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

		<div>

		<?php $this->widget('CCaptcha'); ?>

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

		</div>

		<div class="hint">Var god ange koden i textrutan.</div>

	</div>

	<?php 	

	endif; ?>



Loaded page




	<div class="row">


		<label for="User_verifyCode">Verifications kod</label>		<div>


		<img id="yw0" src="/hyf3/index.php?r=user/captcha&amp;v=4f7ee7f937cef" alt="" />		<input name="User[verifyCode]" id="User_verifyCode" type="text" />		</div>


		<div class="hint">Var god ange koden i textrutan.</div>


	</div>




any idees what the problem can be?

There seems to be nothing wrong in your code, and the html output seems quite fine.

It should be a problem regarding the setup of web server or PHP.

Do you mean that you get a blank white image without captcha letters? Or no image at all?

What about the font file? The default font file for CCapthca is ‘/framework/web/widgets/captcha/Duality.ttf’. Does the running environment of your app have it in the right place and with the right name?

What is the ‘memory_limit’ value in your phpinfo()?

ive got a "cant find image(src)" image.

memory_list: 1924M

Does the running environment of your app have it in the right place and with the right name?

Im not high in Yii, can you please give som exampel in wich way i can check this? thank you

Where does this message appear? On the web browser’s screen? Or in some log file?

What is your environment? I mean, server OS, web server, PHP version, … etc.

sorry, its not a message, its the icon for images that not can be found thats shows insted for the captacha image, im not abel to post in this thread when im new in this forum.

OS win7

Apache 2.2.14

PHP 5.2.11

Okay.

I guess it’s an icon that your browser shows when it failed to get the image.

What about the logs?

I would check 1)apache access log, 2)apache error log and 3)yii application log to see what’s really happening.

try instead of


'allowEmpty'=>!CCaptcha::checkRequirements()

this:


'allowEmpty'=>!extension_loaded('gd')

also instead of using separate array, just add to existing.

So instead of:


  public function accessRules()

        {

                return array(

                        array('allow',  // allow all users to perform 'index' and 'view' actions

                                'actions'=>array('index','view', 'create'),

                                'users'=>array('*'),

                        ),

                        

                        array('allow', 

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

                        'users' => array('*'),

                        ),

Try this:


  public function accessRules()

        {

                return array(

                        array('allow',  // allow all users to perform 'index' and 'view' actions

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

                                'users'=>array('*'),

                        ),