Cannot Access Gii Splash Page

Hello, i’m very new to yii framework. I have installed yii framework on my lamp stack in ubantu 12.04. Now i’m trying to create employees-departments Web application, with a list of departments and a list of employees, each employee being in only one department which is given in one of your tutorials.I have all the required folders such as "CHANGELOG, LICENSE, README, and UPGRADE text documents

demos folder

framework folder

requirements folder"

and

within the application directory:

assets

css

images

index-test.php

index.php

protected

themes

and i have enebled the gii:

‘gii’=>array(

'class'=>'system.gii.GiiModule',


'password'=>'SECURE',

),

and

‘urlManager’=>array(

'urlFormat'=>'path',


'rules'=>array(


    '<controller:w+>/<id:d+>'=>'<controller>/view',


    '<controller:w+>/<action:w+>/<id:d+>'=>'<controller>/<action>',


    '<controller:w+>/<action:w+>'=>'<controller>/<action>',


),

),

and i have enabled the mysql also:

‘db’=>array(

'connectionString' => 'mysql:host=localhost;dbname=testdrive',


'emulatePrepare' => true,


'username' => 'username',


'password' => 'password',


'charset' => 'utf8',

),

And i have createtd a database called testdrive in which i have created two tables:

CREATE TABLE Employee (

id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,


departmentId TINYINT UNSIGNED NOT NULL


    COMMENT "CONSTRAINT FOREIGN KEY (departmentId) REFERENCES Department(id)",


firstName VARCHAR(20) NOT NULL,


lastName VARCHAR(40) NOT NULL,


email VARCHAR(60) NOT NULL,


ext SMALLINT UNSIGNED NULL,


hireDate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,


leaveDate DATETIME NULL,


INDEX name (lastName, firstName),


INDEX (departmentId)

)

and

CREATE TABLE Department (

id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 


name VARCHAR(40),


UNIQUE (name)

)

but now when i’m Creating Models, Views, and Controllers in Yii:

by "localhost/zurmo/yii/framework/gii/views/default" in my browser, it shows:

Welcome to Yii Code Generator!

You may use the following generators to quickly build up your Yii application:

[size="6"]but Its not showing me login screen and its not asking me to enter password and it directly shows:[/size]

Welcome to Yii Code Generator!

You may use the following generators to quickly build up your Yii application:

its [size="6"]"not showing any generators"[/size] below like "model generator","controller generator" etc…

Have i missed something. Please help me to configure it…

[size=2]Hi,[/size]

are you trying to access gii in this way?

http://localhost/(projectname)/gii/default/login

Did u configured your index.php to yii framework path.

<?php

// change the following paths if necessary

$yii=dirname(FILE).’/../yiii/framework/yii.php’;

$config=dirname(FILE).’/protected/config/main.php’;

// remove the following lines when in production mode

defined(‘YII_DEBUG’) or define(‘YII_DEBUG’,true);

// specify how many levels of call stack should be shown in each log message

defined(‘YII_TRACE_LEVEL’) or define(‘YII_TRACE_LEVEL’,3);

require_once($yii);

Yii::createWebApplication($config)->run();

Thanks,

chandran nepolean

Hi,

localhost/zurmo/yii/framework/gii/views/default

Please can you mention your project directory.

By guess if your project directory is zurmo

then u should access

localhost/zurmo/gii

your yii framework folder should be outside the project folder

Thanks

chandran nepolean

NOTE: merged duplicate topics

@vaijanath please stop making duplicate posts

From the path you provided it’s clear you are using ZURMO, so try to get help from the author of zurmo.

In any case if you want to lear Yii - as I already wrote you on the github issue, you need to read first (ad study it) the Definitive Guide to Yii - http://www.yiiframework.com/doc/guide/

Hello chandran, I have a doubt that [size="4"]where to create those database tables? I mean, simply i have created those two tables in my "phpmyadmin". Do i need to create some files and dump sql statements in it? If so, where to create those files i mean in what all the folders i need to create files and dump the sql statements?[/size] here is my sql statements:

CREATE TABLE Employee (

id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,

departmentId TINYINT UNSIGNED NOT NULL

COMMENT "CONSTRAINT FOREIGN KEY (departmentId) REFERENCES Department(id)",

firstName VARCHAR(20) NOT NULL,

lastName VARCHAR(40) NOT NULL,

email VARCHAR(60) NOT NULL,

ext SMALLINT UNSIGNED NULL,

hireDate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

leaveDate DATETIME NULL,

INDEX name (lastName, firstName),

INDEX (departmentId)

)

and

CREATE TABLE Department (

id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,

name VARCHAR(40),

UNIQUE (name)

)

both the tables are in the same database called "testdrive".

ok chandran, i have removed yii from zurmo, now yii is outside of zurmo directory. Here is deirectory:

/var/www/yii/framework/gii/views/default/ in which /var/www/ is my web root directory…

Now i have enabled gii the and set the password too. And i have enabled it in both /var/www/yii/framework/cli/views/webapp/protected/config/main.php and as well as /var/www/yii/testdrive/protected/config/main.php.

Here is my /var/www/yii/framework/cli/views/webapp/protected/config/main.php:

<?php

// uncomment the following to define a path alias

// Yii::setPathOfAlias(‘local’,‘path/to/local-folder’);

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

'basePath'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


'name'=&gt;'My Web Application',





// preloading 'log' component


'preload'=&gt;array('log'),





// autoloading model and component classes


'import'=&gt;array(


	'application.models.*',


	'application.components.*',


),





'modules'=&gt;array(


	// uncomment the following to enable the Gii tool


	


	'gii'=&gt;array(


		'class'=&gt;'system.gii.GiiModule',


		'password'=&gt;'vediclabs',


		// If removed, Gii defaults to localhost only. Edit carefully to taste.


		'ipFilters'=&gt;array('127.0.0.1','::1'),


	),


	


),





// application components


'components'=&gt;array(


	'user'=&gt;array(


		// enable cookie-based authentication


		'allowAutoLogin'=&gt;true,


	),


	// uncomment the following to enable URLs in path-format


	


	'urlManager'=&gt;array(


		'urlFormat'=&gt;'path',


		'rules'=&gt;array(


			'&lt;controller:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/view',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


		),


	),


	


	'db'=&gt;array(


		'connectionString' =&gt; 'sqlite:'.dirname(__FILE__).'/&#46;&#46;/data/testdrive.db',


	),


	// uncomment the following to use a MySQL database


	


	'db'=&gt;array(


		'connectionString' =&gt; 'mysql:host=localhost;dbname=testdrive',


		'emulatePrepare' =&gt; true,


		'username' =&gt; 'root',


		'password' =&gt; 'vediclabs',


		'charset' =&gt; 'utf8',


	),


	


	'errorHandler'=&gt;array(


		// use 'site/error' action to display errors


		'errorAction'=&gt;'site/error',


	),


	'log'=&gt;array(


		'class'=&gt;'CLogRouter',


		'routes'=&gt;array(


			array(


				'class'=&gt;'CFileLogRoute',


				'levels'=&gt;'error, warning',


			),


			// uncomment the following to show log messages on web pages


			/*


			array(


				'class'=&gt;'CWebLogRoute',


			),


			*/


		),


	),


),





// application-level parameters that can be accessed


// using Yii::app()-&gt;params['paramName']


'params'=&gt;array(


	// this is used in contact page


	'adminEmail'=&gt;'webmaster@example.com',


),

);

and here is my /var/www/yii/testdrive/protected/config/main.php:

<?php

// uncomment the following to define a path alias

// Yii::setPathOfAlias(‘local’,‘path/to/local-folder’);

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

'basePath'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


'name'=&gt;'My Web Application',





// preloading 'log' component


'preload'=&gt;array('log'),





// autoloading model and component classes


'import'=&gt;array(


	'application.models.*',


	'application.components.*',


),





'modules'=&gt;array(


	// uncomment the following to enable the Gii tool


	


	'gii'=&gt;array(


		'class'=&gt;'system.gii.GiiModule',


		'password'=&gt;'vediclabs',


		// If removed, Gii defaults to localhost only. Edit carefully to taste.


		'ipFilters'=&gt;array('127.0.0.1','::1'),


	),


	


),





// application components


'components'=&gt;array(


	'user'=&gt;array(


		// enable cookie-based authentication


		'allowAutoLogin'=&gt;true,


	),


	// uncomment the following to enable URLs in path-format


	


	'urlManager'=&gt;array(


		'urlFormat'=&gt;'path',


		'rules'=&gt;array(


			'&lt;controller:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/view',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


		),


	),


	


	'db'=&gt;array(


		'connectionString' =&gt; 'sqlite:'.dirname(__FILE__).'/&#46;&#46;/data/testdrive.db',


	),


	// uncomment the following to use a MySQL database


	


	'db'=&gt;array(


		'connectionString' =&gt; 'mysql:host=localhost;dbname=testdrive',


		'emulatePrepare' =&gt; true,


		'username' =&gt; 'root',


		'password' =&gt; 'vediclabs',


		'charset' =&gt; 'utf8',


	),


	


	'errorHandler'=&gt;array(


		// use 'site/error' action to display errors


		'errorAction'=&gt;'site/error',


	),


	'log'=&gt;array(


		'class'=&gt;'CLogRouter',


		'routes'=&gt;array(


			array(


				'class'=&gt;'CFileLogRoute',


				'levels'=&gt;'error, warning',


			),


			// uncomment the following to show log messages on web pages


			/*


			array(


				'class'=&gt;'CWebLogRoute',


			),


			*/


		),


	),


),





// application-level parameters that can be accessed


// using Yii::app()-&gt;params['paramName']


'params'=&gt;array(


	// this is used in contact page


	'adminEmail'=&gt;'webmaster@example.com',


),

);

but again the same thing is happening…Same issue…