You should add config / console.php to the component array
'request' => array( 'hostInfo' => 'http://localhost', 'baseUrl' => '', 'scriptUrl' => '', ),
and also add urlManager so that it removes index.php? r = site / action from url and you will have nice urls.
'urlManager' => array( 'urlFormat' => 'path', 'showScriptName' => false, 'rules' => array( '<controller:\w+>' => '<controller>/index', '<controller:\w+>/<id:\d+>' => '<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', '<controller:\w+>/<action:\w+>' => '<controller>/<action>', ), ),
source share