PHP warning

Cannot modify header information - headers already sent by (output started at /var/www/zap-online/data/www/zap-online.ru/protected/controllers/automobiles/MarkaAction.php:2)

/var/www/zap-online/data/www/zap-online.ru/protected/controllers/automobiles/MarkaAction.php(134)

122             $vars['modific'] = $modific;
123             $vars['min_year'] = $min_year;
124             $vars['max_year'] = $max_year;
125 
126             $this->controller->render('model' , $vars);
127             die;
128         }elseif($slug != null){
129             $auto = Cars::model()->with('type', 'model')->findAll('t.slug = "'.$slug.'" AND t.species_id = "'.$spec_id.'"');
130             $vars['auto_name'] = isset($auto[0]) && $auto[0]->name != '' ? $auto[0]->name : '';
131             $type = CarsSpecies::model()->findByPk($spec_id);
132 
133             if(count($auto) == 0){
134                 header('HTTP/1.1 301 Moved Permanently');
135                 header('Location: '.$this->controller->createUrl('cars/index'));
136             }
137 
138             //перебрать список техники
139             $tehnika = array();
140             foreach($auto as $_auto){
141                 // если присутствуют можели тогда добавляем таб с техникой
142                 if(count($_auto->model) > 0)
143                     $tehnika[] = $_auto->type;
144             }
145 
146             // SEO

Stack Trace

#0
+
 /var/www/zap-online/data/www/zap-online.ru/protected/controllers/automobiles/MarkaAction.php(134): header("HTTP/1.1 301 Moved Permanently")
129             $auto = Cars::model()->with('type', 'model')->findAll('t.slug = "'.$slug.'" AND t.species_id = "'.$spec_id.'"');
130             $vars['auto_name'] = isset($auto[0]) && $auto[0]->name != '' ? $auto[0]->name : '';
131             $type = CarsSpecies::model()->findByPk($spec_id);
132 
133             if(count($auto) == 0){
134                 header('HTTP/1.1 301 Moved Permanently');
135                 header('Location: '.$this->controller->createUrl('cars/index'));
136             }
137 
138             //перебрать список техники
139             $tehnika = array();
#10
+
 /var/www/zap-online/data/www/zap-online.ru/index.php(19): CApplication->run()
14         defined('YII_DEBUG') or define('YII_DEBUG',true );
15     break;
16 }
17 
18 require_once($yii);
19 Yii::createWebApplication($config)->run();
20 
21 
22 ///test
2019-01-18 09:07:52 Apache/2.2.22 (Debian) Yii Framework/1.1.14