PHP error when trying an simple test console command

Hi, I get this error when trying to execute a Console Command.

What can be wrong here?


$ yiic test

PHP Error[2]: Invalid argument supplied for foreach()

    in file /yii-1.1.16.bca042/framework/collections/CMap.php at line 287

#0 /yii-1.1.16.bca042/framework/base/CModule.php(453): mergeArray()

#1 /yii-1.1.16.bca042/framework/base/CModule.php(508): CConsoleApplication->setComponent()

#2 /yii-1.1.16.bca042/framework/base/CComponent.php(152): CConsoleApplication->setComponents()

#3 /yii-1.1.16.bca042/framework/base/CModule.php(520): CConsoleApplication->__set()

#4 /yii-1.1.16.bca042/framework/base/CApplication.php(165): CConsoleApplication->configure()

#5 /yii-1.1.16.bca042/framework/YiiBase.php(125): CConsoleApplication->__construct()

#6 /yii-1.1.16.bca042/framework/YiiBase.php(113): createApplication()

#7 /yii-1.1.16.bca042/framework/yiic.php(23): createConsoleApplication()

#8 /protected/yiic.php(7): require_once()

#9 /protected/yiic(4): require_once()

/protected/config/console.php


return array(

    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

    'name'=>'My Console Application',

    'import' => array(

        'application.models.*',

        'application.components.*'

    ),

    // application components

    'components'=>array(

        // database settings are configured in database.php

        'db'=>require(dirname(__FILE__).'/database.php'),

        'log'=>array(

            'class'=>'CLogRouter',

            'routes'=>array(

                array(

                    'class'=>'CFileLogRoute',

                    'levels'=>'error, warning',

                ),

            ),

        ),


    ),

);

/protected/yiic.php




$yiic = dirname(__FILE__) . '/../../framework/yii-1.1.16.bca042/framework/yiic.php';

$config = dirname(__FILE__) . '/config/console.php';

require_once($yiic);

Hi,

If you are trying to execute a module make sure you have configured it in your console.php





'modules' => [

        'YourModule',

    ],



If not a module related problem then make sure about your URL routing