Yii framework config/main.php doesnt contain gii to work with -


i have been using vagrant yii framework, have created virtual server , have put yii framework there. connected database , works fine, when go index.php?r=gii following

error:error 403 not allowed access page. 

well looked online , website found few solutions, such going config/main.php , there change allowedips however, when go main.php see:

<?php  /**  * main web application configuration.  *  * writable cwebapplication properties can configured here.  * constructed following way:  *    main.php = return main settings  *                  unless overwritten local main settings if available  *                  unless overwritten test settings if available  *                  unless overwritten local test settings if available  * (mergearray: latter overwrite former, see http://www.yiiframework.com/doc/api/1.1/cmap#mergearray-detail)  *  * @author yii, adapted robbert <paulussen@momentum-technologies.nl>  * @since release 1.0 (sprint 1)  */ // set path variables reflect directory structure // $webhome/                     -- doepath // $webhome/public/              -- webrootpath // $webhome/private/protected/   -- protectedpath // $webhome/private/runtime/     -- runtimepath  $pathtodoedirectory  = realpath(dirname(__file__) . '/../../..'); $privatepath         = $pathtodoedirectory . '/private/'; $protectedpath       = $pathtodoedirectory . '/private/protected/'; $runtimepath         = $pathtodoedirectory . '/private/runtime/'; $publicpath          = $pathtodoedirectory . '/public/'; $webrootpath         = $publicpath;  /**  * namespace mte  */ yii::setpathofalias('mte', $protectedpath);  // used themeurl of widgetfactory settings, in case doe in subdirectory $baseurl = (isset($_server['document_root'])) ? str_replace($_server['document_root'], '', realpath('.')) : '';  //define('eol','<br/>'); //echo '$pathtoccsdirectory = ' . $pathtoccsdirectory . php_eol; //echo '$privatepath = ' . $privatepath . php_eol; //echo '$protectedpath = ' . $protectedpath . php_eol; //echo '$runtimepath = ' . $runtimepath . php_eol; //echo '$publicpath = ' . $publicpath . php_eol; //echo '$webrootpath = ' . $webrootpath . php_eol; /** following defines path aliases using:   yii::setpathofalias('local','path/to/local-folder');  * usage e.g.  ... yii::getpathofalias('runtimepath') ...  */ yii::setpathofalias('doepath', $pathtodoedirectory); yii::setpathofalias('privatepath', $privatepath); yii::setpathofalias('publicpath', $publicpath); yii::setpathofalias('protectedpath', $protectedpath); yii::setpathofalias('runtimepath', $runtimepath); yii::setpathofalias('webrootpath', $webrootpath); $config_database = require(dirname(__file__) . '/database.php');  $config_main = array(     'sourcelanguage' => 'en',     'timezone'       => 'europe/amsterdam',     'basepath'       => $protectedpath,     // override default of yii     'runtimepath'    => $runtimepath,     'name'           => yii::t('system', 'doe web application'),     // preloading 'log' component     'preload'        => array(         'log',         'translate',     ),     // autoloading model , component classes, note importing directory not import of subdirectories!     'import' => array(         'application.components.*',         'application.models.*',         'application.modules.rights.*',         'application.modules.rights.components.*',         'application.modules.translate.translatemodule',     ),     'modules' => array(         'translate',         'rights' => array(             'install'        => false, // whether install rights.             'usernamecolumn' => 'login', // name of user name column in database.             'userclass'      => 'rightsmoduleuser', // extended user model             'cssfile'        => '/mte/modules/rights/default.css', // custom css rights module         /* more options */ //          'applayout'          => 'application.views.layouts.main', // application layout. //          'authenticatedname'  => 'authenticated',                // name of authenticated user role. //          'baseurl'            => '/rights',                      // base url rights. change if module nested. //          'debug'              => false,                          // whether enable debug mode. //          'displaydescription' => true,                           // whether use item description instead of name. //          'enablebizrule'      => true,                           // whether enable authorization item business rules. //          'enablebizruledata'  => false,                          // whether enable data business rules. //          'flasherrorkey'      => 'rightserror',                  // key use setting error flash messages. //          'flashsuccesskey'    => 'rightssuccess',                // key use setting success flash messages. //          'layout'             => 'rights.views.layouts.main',    // layout use displaying rights. //          'superusername'      => 'admin',                        // name of role super user privileges. //          'useridcolumn'       => 'id',                           // name of user id column in database.         ),         // whether enable installer.         // application components         'components'     => array(             'user' => array(                 'class'          => 'webuser',                 /* enable cookie-based authentication */                 'allowautologin' => true,                 /* @see http://www.yiiframework.com/doc/guide/1.1/en/topics.auth */                 'loginurl'       => array('/site/login'),             ),             'authmanager' => array(                 'class'          => 'rdbauthmanager',                 'connectionid'   => 'db',                 'defaultroles'   => array('authenticated', 'user'),             ),             'messages' => array(                 'class'                  => 'cdbmessagesource',                 'onmissingtranslation'   => array('translatemodule',                     'missingtranslation',                 ),                 'translate' => array(                     'class'              => 'translate.components.mptranslate',                     'acceptedlanguages'  => array(                         'en'         => 'english',                         'nl'         => 'nederlands',                     ),                 ),             ),             //use component store cookies             'cookies'    => array(                 'class'      => 'application.components.cookieshelper'             ),             // uncomment following enable urls in path-format             'urlmanager' => array(                 'urlformat'      => 'path',                 'showscriptname' => false,                 'rules'          => array(                     '<controller:\w+>/<id:\d+>'              => '<controller>/view',                     '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',                     '<controller:\w+>/<action:\w+>'          => '<controller>/<action>',                 ),             ),             'errorhandler'                           => array(                 // use 'site/error' action display errors                 'erroraction'    => 'site/error',             ),             'log'            => array(                 'class'  => 'clogrouter',                 'routes' => array(                     array(                         'class'  => 'cfilelogroute',                         'levels' => 'info, warning, error',                     ),                 ),             ),         ),     ),     /** application-level parameters can accessed      *  using yii::app()->params['paramname']      */     'params' => array(         // used in contact page         'adminemail'         => 'ddd@sdaadad-dsdsdsa.nl',         'cookie_duration'    => 3600 * 24 * 30,         'composer.callbacks' => array(             // args yii command runner             'yiisoft/yii-install' => array('yiic', 'webapp', dirname(__file__) . directory_separator . '..' . directory_separator . '..'),             'post-update' => array('yiic', 'migrate'),             'post-install' => array('yiic', 'migrate'),         ),     ), ); $maindbincluded = cmap::mergearray($config_database, $config_main);  // include , merge local main config if exists if (file_exists(dirname(__file__) . '/main-local.php')) {     return cmap::mergearray($maindbincluded, include(dirname(__file__) . '/main-local.php')); } // otherwise load main config file return $maindbincluded; 

and main-local.php:

<?php  /**  * main web application configuration.  *  * file local developers machine.  */ yii::setpathofalias('mte', '/var/www/private/protected/'); // following lines may not run when in production mode, should in ..-local.php defined('yii_debug') or define('yii_debug', true); // specify how many levels of call stack should shown in each log message defined('yii_trace_level') or define('yii_trace_level', 5);  return array(     'modules' => array(         // uncomment following enable gii tool         'gii' => array(             'class'      => 'system.gii.giimodule',             'password'   => 'password',             // if removed, gii defaults localhost only. edit taste.             'ipfilters'  => array('127.0.0.1', '::1'),         ),     ),     'components' => array( //      'urlmanager' => array( //          'urlformat'      => 'path', //          'showscriptname' => false, //      ), //      'cache'  => array( //          'class'                  => 'cdbcache', //          'connectionid'           => 'db', //          'autocreatecachetable'   => true, //      ), //      'db'     => array(  //          'schemacachingduration' => 3600, //      ),         'log' => array(             'class'  => 'clogrouter',             'routes' => array(                 array(                     'class'  => 'cfilelogroute',                     'levels' => 'trace, info, warning, error',                 //       'categories' => 'system.*',                 ),                 array(                     'class'  => 'cweblogroute',                     'levels' => 'error, warning, info, trace',                 ),                 /*                   array(                   'class' => 'cemaillogroute',                   'levels' => 'error, warning',                   'emails' => 'sddsd@m-sdsdsd.nl',                   ),                  */                 array(                     'class'              => 'cprofilelogroute',                 ),             ),         ),     ),     'params'             => array(         'adminemail' => 'sssss@m-sdsdsdsd.nl', // used in contact page     ), ); 

how can fix gii problem here??

you wrong! allowed access gii everyone. can rewrite classes...

write address of computer or address mask of network ipfilter parameter.

another way comment out gii module after finish work it.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -