Console Applicaion

how can create console application of web application

no, you can’t do this, it is 2 different types of applications. you can use almost same config for console application, but it is still 2 different apps (CWebApplication and CConsoleApplication).

I use a configuration file which I call ‘common.php’ in the configuration directory.

I then include and ‘merge’ that with the web/console or test specific configuration in ‘main.php’ for instance:

$common = require(dirname(__FILE__).'/common.php');

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

$mainconf= array(








            // enable cookie-based authentication


            'loginUrl' => array('access/signin')



return CMap::mergeArray($common,$mainconf);

Posibly you need to include CMap somewhere (I can’t see where I do it currently):


where $yii is the Yii directory.

Actually, I would like to use an application like a software and create a shortcut so i can use that application from desktop …

if i will create a web application then i will have to run that application on localhost.but don’t want to do that.

like to use that application from desktop not from localhost…

You can do that. You have to create a Console Application ( ) which implies adjusting the configuration.

I use a mix for instance: some Console Applications to perform cron jobs or to fetch data from the database in the appropriate format for other server apps reacting to sockets, and the Web Application providing the HMI.

hello le_top…

i have tried my best but i am not able to create…

so plz elaborate the step of creating a console application …

You can’t even figure out reading the docs?