How to change max execution time

Hi all, Can anybody help me how to change the Maximum execution time of this framework. I got this error when processing 4,312 records.

Here is my function:

public function synchronizeUsers() {

	$encrypter = new crypt;


	$emp = Yii::app()->db->createCommand("SELECT EMP_NO, EMP_LNAME, EMP_FNAME, EMP_MNAME, EMP_EMAIL FROM EMPLOYEE LEFT JOIN Users On EMPLOYEE.EMP_NO = Users.empno WHERE Users.empno is null");

	$dataReader=$emp->queryAll(); // execute a query SQL


	//$rows = $dataReader->read();

	$sql="INSERT INTO users (username,password, email,empno) VALUES(:username,:password,:email,:empno)";

	$command= Yii::app()->db->createCommand($sql);

	foreach($dataReader as $row ) {

	try {	

                    //username of the user for temporary fname+empno

		$username = $row['EMP_FNAME'].$row['EMP_NO'];


		//password is compose of lname+empno

		$password = $encrypter->encrypt(trim($row['EMP_LNAME']).$row['EMP_NO']);








	catch(Exception $e) {






I got a Fatal error: Maximum execution time of 60 seconds exceeded in D:\workspace\php\htdocs\yii\framework\db\CDbCommand.php on line 193

You need to change that in the php.ini:

max_execution_time = 30

In your php script:

set_time_limit(180); // Set max execution time 3 minutes.

Thanks guys.