Yii Framework Forum: Cannot Access Gii Splash Page - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cannot Access Gii Splash Page Rate Topic: -----

#1 User is offline   vaijanath 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 09-October 13
  • Location:Bengaluru

Posted 10 October 2013 - 12:32 AM

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:
but Its not showing me login screen and its not asking me to enter password and it directly shows:
Welcome to Yii Code Generator!

You may use the following generators to quickly build up your Yii application:
its "not showing any generators" below like "model generator","controller generator" etc..
Have i missed something. Please help me to configure it..
0

#2 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 488
  • Joined: 08-October 12
  • Location:Austria

Posted 10 October 2013 - 03:34 AM

Hi,

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
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#3 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 488
  • Joined: 08-October 12
  • Location:Austria

Posted 10 October 2013 - 06:32 AM

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
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#4 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,346
  • Joined: 12-October 09
  • Location:Croatia

Posted 10 October 2013 - 07:55 AM

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/
Find more about me.... btw. Do you know your WAN IP?
0

#5 User is offline   vaijanath 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 09-October 13
  • Location:Bengaluru

Posted 11 October 2013 - 03:37 AM

View Postchandran, on 10 October 2013 - 06:32 AM, said:

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

Hello chandran, I have a doubt that 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? 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".
0

#6 User is offline   vaijanath 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 09-October 13
  • Location:Bengaluru

Posted 11 October 2013 - 03:47 AM

View Postchandran, on 10 October 2013 - 06:32 AM, said:

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

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'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Web Application',

// preloading 'log' component
'preload'=>array('log'),

// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),

'modules'=>array(
// uncomment the following to enable the Gii tool

'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'vediclabs',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),

),

// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
// uncomment the following to enable URLs in path-format

'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>',
),
),

'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
// uncomment the following to use a MySQL database

'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=testdrive',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'vediclabs',
'charset' => 'utf8',
),

'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
),

// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'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'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Web Application',

// preloading 'log' component
'preload'=>array('log'),

// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),

'modules'=>array(
// uncomment the following to enable the Gii tool

'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'vediclabs',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),

),

// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
// uncomment the following to enable URLs in path-format

'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>',
),
),

'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
// uncomment the following to use a MySQL database

'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=testdrive',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'vediclabs',
'charset' => 'utf8',
),

'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
),

// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'webmaster@example.com',
),
);
but again the same thing is happening..Same issue...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users