Internal Server Error When Load Ajax In Yii

I had problem in loading Ajax , I knew that by got screanshot of request by Tamper Data :

http://up.arabseyes…13544389861.jpg

result was : internal server Error . What is the problem in my code ?

View




<?php

/* @var $this UsersController */

/* @var $model Users */

/* @var $form CActiveForm */

?>


<div class="form">


<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'users-index-form',

	'enableAjaxValidation'=>false,

)); ?>








	


	<?php echo $form->errorSummary($model); ?>


	<div class="row">

		<?php echo $form->labelEx($model,'الأسم الأول'); ?>

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

		<?php echo $form->error($model,'الأسم الاول'); ?>

	</div>


	<div class="row">

		<?php echo $form->labelEx($model,'العائلة'); ?>

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

		<?php echo $form->error($model,'العائلة'); ?>

	</div>


	<div class="row">

		<?php echo $form->labelEx($model,'كلمة المرور'); ?>

		<?php echo $form->passwordField($model,'password'); ?>

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

	</div>

	<div class="row">

		<?php echo $form->labelEx($model,'تأكيد كلمة المرور'); ?>

		<?php echo $form->passwordField($model,'passwordconfirm'); ?>

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

	</div>


	<div class="row">

		<?php echo $form->labelEx($model,'البريد الإلكتروني '); ?>

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

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

	</div>

		<div class="row">

		<?php echo $form->labelEx($model,'تأكيد البريد الإلكتروني'); ?>

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

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

	</div>


		<div class="row">

		<?php echo $form->labelEx($model,'تاريخ الميلاد'); ?>

	<?php


$this->widget(

	'ext.jui.EJuiDateTimePicker',

	array(

    	'model' 	=> $model,

    	'attribute' => 'birth_date',

    	'language'=> 'en',//default Yii::app()->language

 		'mode'	=> 'date',//'datetime' or 'time' ('datetime' default)

    	'options'   => array(

    	'dateFormat' => 'yy-mm-dd',

        	//'timeFormat' => '',//'hh:mm tt' default

    	),

	)

);




?>


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

	</div>








	<div class="row">

		<?php echo $form->labelEx($model,'الجنس'); ?>

		<?php echo chtml::activeDropDownList($model,'gender',$model->getStatusOption(),array('prompt'=>'أختر جنسك')

); ?>

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

	</div>


		<div class="row">

		<?php echo $form->labelEx($model,'البلد'); ?>

	<?php

	

	/*

 	echo chtml::activeDropDownList($model,'country',$model->getcountry(),array('prompt'=>'اختر بلدك ')   , 

	array(

'ajax' => array(

'type'=>'POST', //request type

'url'=>CController::createUrl('current/dynamiccities'), //url to call.

//Style: CController::createUrl('currentController/methodToCall')

'update'=>'#city', //selector to update

//'data'=>'js:javascript statement' 

//leave out the data key to pass all form values through

))

	

	); 

	

	*/

	echo CHtml::activedropDownList($model,'country',$model->getcountry(),

	

	array(

'ajax' => array(

'type'=>'POST', //request type

'url'=>CController::createUrl('Register/dynamiccities'), //url to call.

//Style: CController::createUrl('currentController/methodToCall')

'update'=>'#city', //selector to update

//'data'=>'js:javascript statement' 

//leave out the data key to pass all form values through

))

	);

   

	

	?>

 

	

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

	</div>

	<div class="row">

		<?php echo $form->labelEx($model,'المدينة'); ?>

		<?php 

   	//empty since it will be filled by the other dropdown

echo CHtml::dropDownList('city','', array());

 ?>

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

	</div>





	<div class="row">

		<?php echo $form->labelEx($model,'رمز الاتصال'); ?>

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

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

	</div>


	<div class="row">

		<?php echo $form->labelEx($model,'رقم الجوال'); ?>

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

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

	</div>







	<div class="row buttons">

		<?php echo CHtml::submitButton('تسجيــــــــــــل'); ?>

	</div>


<?php $this->endWidget(); ?>


</div><!-- form -->



Controller :




...

public function actionDynamiccities() /// Called Ajax

{

	

 $data=Cities::model()->findAll('country=:country_id', 

              	array(':country_id'=>(int) $_POST['country']));

 

	$data=CHtml::listData($data,'id','city_name_e');

	foreach($data as $value=>$name)

	{

    	echo CHtml::tag('option',

               	array('value'=>$value),CHtml::encode($name),true);

	};

	

}  

   

...



thanks in advance

If your server is using Suhosin (hardened php patch) check owner of the file containing your action. A wrong owner causes this type of error (and this is not related specifically to ajax)

guaruja , I am working by xampp on localhost .

Up :)