Yii Framework Forum: Can't get past Gii login page - Yii Framework Forum

Jump to content

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

Can't get past Gii login page Rate Topic: ***** 4 Votes

#1 User is offline   joseph 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 03-June 10

Posted 03 June 2010 - 04:27 AM

I am a newbie to Yii and have been trying to get through creating my first Yii application from the 'Getting Started' section.

When I get to the section in regards to setting up and logging into Gii, everything goes fine until I actually try to log into the application. When I log in and provide the correct password (the one I set within the main.php file), it takes me back to the login prompt. If I provide an incorrect password, it gives me an error indicating the password is incorrect. So, I know it's using my correct password. It's like the page is in an infinite loop or it's having problems loading the index.php page for some reason. Any ideas?

I also noticed that I get the following error in my apache error logs when using the Gii application (NOTE: C:/localwork/workspace_pprl is my Apache DocumentRoot):

[Thu Jun 03 04:59:52 2010] [error] [client 127.0.0.1] File does not exist: C:/localwork/workspace_pprl/testdrive/fancybox
[Thu Jun 03 04:59:52 2010] [error] [client 127.0.0.1] File does not exist: C:/localwork/workspace_pprl/testdrive/fancybox
[Thu Jun 03 04:59:52 2010] [error] [client 127.0.0.1] File does not exist: C:/localwork/workspace_pprl/testdrive/fancybox
[Thu Jun 03 04:59:52 2010] [error] [client 127.0.0.1] File does not exist: C:/localwork/workspace_pprl/testdrive/fancybox
[Thu Jun 03 04:59:52 2010] [error] [client 127.0.0.1] File does not exist: C:/localwork/workspace_pprl/testdrive/fancybox
[Thu Jun 03 04:59:52 2010] [error] [client 127.0.0.1] File does not exist: C:/localwork/workspace_pprl/testdrive/fancybox


I am using Apache 2.2.15 / PHP 5.2.3 on Windows XP with IE 7 and Firefox 3.6.3.


Any help would be greatly appreciated. I've been stuck here for a couple days now and have not been able to find anything on the web describing what may be going on.
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 03 June 2010 - 05:18 AM

Gii by default restricts access to localhost. Maybe that's your problem? You have to configure the ipFilters parameter either to your IP address or to false to allow access from everywhere (dangerous though!).
0

#3 User is offline   joseph 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 03-June 10

Posted 03 June 2010 - 06:59 AM

Mike,
Well at least now I'm getting beyond the login page. I am now getting an access denied error...which I now need to research. :( I use http://localhost/tes...i/default/login as my request

Quote

Error 403
You are not allowed to access this page.


I first added the following IP filter, which didn't do anything

'ipFilters' => array('127.0.0.1','localhost','172.20.10.186'),

I then added the dreaded 'false' setting, which then caused the access Error page:

'ipFilters'=>array('false'),

Any suggestions? I saw there was a post earlier that didn't have an answer on the fix....other than localhost is suppose to be the default.


From the (Gii Documentation, it says that access to Gii from localhost is enabled by default...which is what I'm doing.

Quote

By default for security reasons, Gii is configured to be accessible only on localhost. If we want to make it accessible on other trustable computers, we can configure the GiiModule::ipFilters property as shown in the above code.


I guess that really threw me off. I thought about adding localhost as a filter, but if it's enabled by default...why would I. I'll have to put in a change request to get that corrected in the documentation.


Any more help would be greatly appreciated.
0

#4 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 03 June 2010 - 07:46 AM

The default behavior should work for most users i think, as no one ever complained, that it doesn't.

From checking the code of GiiModule, this is the way Gii finds your current IP:

Yii::app()->request->userHostAddress


So maybe print that out from some action to see, what's the actual IP address Gii is seeing for your client.

About access denied: What error do you get?
0

#5 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 03 June 2010 - 07:49 AM

Sorry, didn't see you pasted the error already. Maybe enable YII_DEBUG to see the complete call stack for that error?
0

#6 User is offline   joseph 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 03-June 10

Posted 03 June 2010 - 12:07 PM

Yes, I did verify that the
Yii::app()->request->userHostAddress
did return 127.0.0.1. Therefore, that explains why the addition of the ipFilters for localhost or 127.0.0.1 didn't change anything.

If I set the ipFilters to 'false', I get the following error

in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 12:59:01 [error] [exception.CHttpException.403] exception 'CHttpException' with message 'You are not allowed to access this page.' in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php:162
Stack trace:
#0 C:\localwork\workspace_pprl\yii\framework\web\CController.php(255): GiiModule->beforeControllerAction(Object(DefaultController), Object(CInlineAction))
#1 C:\localwork\workspace_pprl\yii\framework\web\CWebApplication.php(320): CController->run('login')
#2 C:\localwork\workspace_pprl\yii\framework\web\CWebApplication.php(120): CWebApplication->runController('gii/default/log...')
#3 C:\localwork\workspace_pprl\yii\framework\base\CApplication.php(135): CWebApplication->processRequest()
#4 C:\localwork\workspace_pprl\testdrive\index.php(12): CApplication->run()
#5 {main} REQUEST_URI=/testdrive/index.php?r=gii/default/login
2010/06/03 12:59:01 [trace] [system.CModule] Loading "errorHandler" application component
2010/06/03 12:59:01 [trace] [system.CModule] Loading "user" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (168)
2010/06/03 12:59:01 [trace] [system.CModule] Loading "session" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (168)
2010/06/03 12:59:01 [trace] [system.CModule] Loading "clientScript" application component
in C:\localwork\workspace_pprl\yii\framework\gii\views\layouts\main.php (2)
in C:\localwork\workspace_pprl\yii\framework\gii\views\layouts\column1.php (7)
in C:\localwork\workspace_pprl\yii\framework\gii\controllers\DefaultController.php (27)
2010/06/03 12:59:01 [trace] [system.CModule] Loading "assetManager" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (136)
in C:\localwork\workspace_pprl\yii\framework\gii\views\layouts\main.php (3)
in C:\localwork\workspace_pprl\yii\framework\gii\views\layouts\column1.php (7)



So I would like to stick with the localhost issue without turning off the ipFilters. In addition to getting the errors from the apache server (mentioned in original post), I get the following from the apache access logs

127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/index.php?r=gii/default/login HTTP/1.1" 200 2403
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/css/screen.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/css/print.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/css/ie.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/css/main.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/jquery.fancybox-1.3.1.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/c4b0baf3/jquery.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/js/tools.tooltip-1.1.3.min.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/jquery.fancybox-1.3.1.pack.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/js/main.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/images/logo.png HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/blank.gif HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_loading.png HTTP/1.1" 404 234
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_close.png HTTP/1.1" 404 232
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_nav_right.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_nav_left.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_shadow_nw.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_shadow_w.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_shadow_sw.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_shadow_s.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_shadow_se.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_shadow_e.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_shadow_ne.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:21 -0400] "GET /testdrive/fancybox/fancy_shadow_n.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:54:23 -0400] "POST /testdrive/index.php?r=gii/default/login HTTP/1.1" 302 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/index.php?r=gii HTTP/1.1" 302 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/index.php?r=gii/default/login HTTP/1.1" 200 2403
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/css/screen.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/css/print.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/css/ie.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/css/main.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/jquery.fancybox-1.3.1.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/c4b0baf3/jquery.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/js/tools.tooltip-1.1.3.min.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/jquery.fancybox-1.3.1.pack.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/js/main.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/images/logo.png HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/blank.gif HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_loading.png HTTP/1.1" 404 234
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_close.png HTTP/1.1" 404 232
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_nav_right.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_nav_left.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_shadow_nw.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_shadow_w.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_shadow_sw.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_shadow_s.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_shadow_se.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_shadow_e.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_shadow_ne.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:54:24 -0400] "GET /testdrive/fancybox/fancy_shadow_n.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/index.php?r=gii/default/login HTTP/1.1" 200 2403
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/4e9f0adc/css/screen.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/4e9f0adc/css/print.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/4e9f0adc/css/ie.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/4e9f0adc/css/main.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/c4b0baf3/jquery.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/jquery.fancybox-1.3.1.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/4e9f0adc/js/tools.tooltip-1.1.3.min.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/jquery.fancybox-1.3.1.pack.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/4e9f0adc/js/main.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:31 -0400] "GET /testdrive/assets/4e9f0adc/images/logo.png HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/blank.gif HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_loading.png HTTP/1.1" 404 234
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_close.png HTTP/1.1" 404 232
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_nav_right.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_nav_left.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_shadow_nw.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_shadow_w.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_shadow_sw.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_shadow_s.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_shadow_se.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_shadow_e.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_shadow_ne.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:32 -0400] "GET /testdrive/fancybox/fancy_shadow_n.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:35 -0400] "POST /testdrive/index.php?r=gii/default/login HTTP/1.1" 302 -
127.0.0.1 - - [03/Jun/2010:12:55:35 -0400] "GET /testdrive/index.php?r=gii HTTP/1.1" 302 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/index.php?r=gii/default/login HTTP/1.1" 200 2403
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/css/print.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/css/screen.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/css/ie.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/jquery.fancybox-1.3.1.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/css/main.css HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/c4b0baf3/jquery.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/js/tools.tooltip-1.1.3.min.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/jquery.fancybox-1.3.1.pack.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/js/main.js HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/images/logo.png HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/assets/4e9f0adc/js/fancybox/blank.gif HTTP/1.1" 304 -
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_loading.png HTTP/1.1" 404 234
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_close.png HTTP/1.1" 404 232
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_nav_right.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_nav_left.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_shadow_nw.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_shadow_w.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_shadow_sw.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_shadow_s.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_shadow_se.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_shadow_e.png HTTP/1.1" 404 235
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_shadow_ne.png HTTP/1.1" 404 236
127.0.0.1 - - [03/Jun/2010:12:55:36 -0400] "GET /testdrive/fancybox/fancy_shadow_n.png HTTP/1.1" 404 235


Not sure why it's trying to reference the /testdrive/fancybox/ because that doesn't exist. I tried to actually copy the /fancybox/ directory at the document root as well, and it cleaned up the messages, but still no go.

The application.log under /protected/runtime/ didn't have anything that looked useful. I didn't change any of the debug/trace info in the index.php

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);


And have the following levels in the main.php to enable logging (error, warning, debug, trace, info).

Here is what's in application.log after I hit submit with the password:

2010/06/03 13:06:20 [trace] [system.CModule] Loading "log" application component
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "request" application component
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "urlManager" application component
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.base.CModule] Loading "gii" module
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "user" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (168)
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "session" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (168)
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "log" application component
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "request" application component
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "urlManager" application component
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.base.CModule] Loading "gii" module
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "user" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (168)
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "session" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (168)
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "log" application component
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "request" application component
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "urlManager" application component
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.base.CModule] Loading "gii" module
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "user" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (168)
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "session" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (168)
in C:\localwork\workspace_pprl\testdrive\index.php (12)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "clientScript" application component
in C:\localwork\workspace_pprl\yii\framework\gii\views\layouts\main.php (2)
in C:\localwork\workspace_pprl\yii\framework\gii\views\layouts\column1.php (7)
in C:\localwork\workspace_pprl\yii\framework\gii\controllers\DefaultController.php (47)
2010/06/03 13:06:20 [trace] [system.CModule] Loading "assetManager" application component
in C:\localwork\workspace_pprl\yii\framework\gii\GiiModule.php (136)
in C:\localwork\workspace_pprl\yii\framework\gii\views\layouts\main.php (3)
in C:\localwork\workspace_pprl\yii\framework\gii\views\layouts\column1.php (7)



Sorry this is long winded.

Thanks again for your help.
0

#7 User is offline   joseph 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 03-June 10

Posted 03 June 2010 - 08:52 PM

I did some more testing and if I set the password to false, I can get in without any problems.

        'modules'=>array(
	       'gii'=>array(
	            'class'=>'system.gii.GiiModule',
	            'password'=>false,
	        ),
	    ),


Not sure why when I provide a password, I can't get off the login page. I've been using 'test' as the password (tried a few others as well). It's like it's recognizing the password because if it put in the wrong password...then it give me the invalid password message.

It looks like it has to do something in the GIIModule.php beforeControllerAction(...) method. I did a trace on the $route variable and it's default/login...which is correct. I assume we are always going to be a Guest?

Any thoughts? I'll continue to research.
0

#8 User is offline   joseph 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 03-June 10

Posted 03 June 2010 - 09:14 PM

Found the problem....not sure why. But in the gii.models.LoginForm.php file there is a function called login(). That in turn calls a method called

Yii::app()->user->login($this->_identity);


If I pass in a numerical value greater than 0.....it works! (see below)

Yii::app()->user->login($this->_identity,100);


Is this a bug? Can you explain to me why I need to do this and everyone else doesn't...if it's not a bug.

The CWebUser login(..) method has the following comments:

	 * @param integer number of seconds that the user can remain in logged-in status. Defaults to 0, meaning login till the user closes the browser.
	 * If greater than 0, cookie-based login will be used. In this case, {@link allowAutoLogin}
	 * must be set true, otherwise an exception will be thrown.


Any ideas?
0

#9 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 04 June 2010 - 01:49 AM

Yii allows for cookie based login. Maybe you have stored some autoLogin cookie, when you did your first tests. Just remove the cookies for localhost from you browser and try again.
0

#10 User is offline   joseph 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 03-June 10

Posted 06 June 2010 - 07:54 AM

I think I found the problem, although I am still researching how to fix it.

It's like the web server isn't able to store sessions at all. I created a simple PHP page that starts a session, stores a variable (if it doesn't exist or increments it if it does exist), then display it on the web page. Every time the page is hit, a new session is created.

The one good thing that is coming out of this is that I got hands on use of debugging PHP files in Eclipse PDT. It seems to work OK, although I had to have my workspace root as the document root in order to be able to modify and run them. Not sure if that is the best practice...but it worked for now.
0

#11 User is offline   joseph 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 03-June 10

Posted 06 June 2010 - 10:56 AM

Fixed it! :))

It was a setting within the php.ini file. I had a full directory path for the
session.save_path
variable instead of a relative path from the PHP root directory.

I originally had (tried it with the \ as file separators as well)
session.save_path = "c:/localwork/php/temp"


but then changed it to
session.save_path = "/temp"


and now the session works OK within the Apache/PHP server and the Gii application works as well.

Thank you Mike for all your help. If you have any recommendations or can point me to best practices for a development environment for PHP/Yii development...that would be great. I come from 13 years experience with Java/J2EE development with EAR/WAR packaging, etc. I see some things are pretty similar, but others are different.

Thanks again.
0

#12 User is offline   rpodsada 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 05-February 12

Posted 05 February 2012 - 06:19 PM

Thanks joseph, this worked for me as well. In my case, I am using WampServer 2 on Windows Vista. When I installed WampServer, I never installed it to the default directory (C:\wamp). However, session.save_path in PHP.ini was still set to C:\wamp\tmp which didn't exist on my system at all. I changed it to the relative path as suggested and it works great now.
1

#13 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 05 February 2012 - 06:23 PM

There is one basic rule to follow:

Do not change the defaults unless you know exactly what you are doing!

And by default: you don't.Posted Image

Wampserver installation routine needs to make this more clear.
"Less noise - more signal"
0

#14 User is offline   mercurius 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 01-March 12

Posted 01 March 2012 - 07:48 PM

It worked when I removed the firefox browser cookies for the domain.
0

#15 User is offline   karlhenselin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 11-May 13

Posted 11 May 2013 - 08:27 PM

Thanks for this great article. My problem was that WebMatrix's default PHP_Session_Path was not writable by my computer user account. I never would have figured that out without your help!
0

#16 User is offline   Shahir Reza Ali 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 11-December 13

Posted 30 December 2013 - 10:50 AM

View Postjoseph, on 06 June 2010 - 10:56 AM, said:

Fixed it! :))

It was a setting within the php.ini file. I had a full directory path for the
session.save_path
variable instead of a relative path from the PHP root directory.

I originally had (tried it with the \ as file separators as well)
session.save_path = "c:/localwork/php/temp"


but then changed it to
session.save_path = "/temp"


and now the session works OK within the Apache/PHP server and the Gii application works as well.

Thank you Mike for all your help. If you have any recommendations or can point me to best practices for a development environment for PHP/Yii development...that would be great. I come from 13 years experience with Java/J2EE development with EAR/WAR packaging, etc. I see some things are pretty similar, but others are different.

Thanks again.


mine is set to

session.save_path="/Applications/XAMPP/xamppfiles/temp/"


and permission is set to 777 for the temp/ folder. still no luck here :(
0

Share this topic:


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

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