PHP warning

Cannot modify header information - headers already sent by (output started at /home/chaowarit/domains/teedindd.com/public_html/realia/ad_AdController.php:1)

/home/chaowarit/domains/teedindd.com/public_html/realia/ad_AdController.php(194)

182     {
183         if(isset($_GET['search_string'])){
184             $this->redirect(Yii::app()->createUrl('ad/index', array('search_string' => $_GET['search_string'])), true, 301);
185         } else {
186             $this->redirect(SITE_URL, true, 301);
187         }
188     }
189     
190     public function actionDetail()
191     {    
192         $adId = isset($_GET['id']) ? $_GET['id']: null;
193         if($adId != 137021) {
194             header('Location: http://www.teedindd.com/th/error/Error404.php');
195             exit;
196         }
197         if(empty($adId) || (int)$adId == 0){
198             $this->render('error_tpl');
199         }
200 
201         if(!empty( $adId ) && is_numeric( $adId )){
202             $adInfo = Ad::model()->with('location', 'category', 'pics')->findByPk( $adId );
203             if(!$adInfo)
204                 $this->redirect(SITE_URL);
205             
206             //update hits

Stack Trace

#0
+
 /home/chaowarit/domains/teedindd.com/public_html/realia/ad_AdController.php(194): header("Location: http://www.teedindd.com/th/error/Error404.php")
189     
190     public function actionDetail()
191     {    
192         $adId = isset($_GET['id']) ? $_GET['id']: null;
193         if($adId != 137021) {
194             header('Location: http://www.teedindd.com/th/error/Error404.php');
195             exit;
196         }
197         if(empty($adId) || (int)$adId == 0){
198             $this->render('error_tpl');
199         }
#8
+
 /home/chaowarit/domains/teedindd.com/public_html/index.php(51): CApplication->run()
46 
47 //define('YII_ENABLE_ERROR_HANDLER', true);
48 //define('YII_ENABLE_EXCEPTION_HANDLER', true);
49 
50 require_once($yii);
51 Yii::createWebApplication($config)->run();
2017-01-22 23:11:31 Apache 2.0.59 Secured Yii Framework/1.1.9