cannot login to gii


I just following the yii-blog.pdf from the documentation, when I tried to login to gii, it keep showing me the login form all the time.

I create a virtual host for this like

and then tried to access from

in the config/main.php


		// uncomment the following to enable the Gii tool







when I type the wrong password the form could say "Incorrect password."

but when I type the correct one, it didn’t say any error and it keep showing me the login form.

btw I am using YII 1.1.5

any idea how to solve this ?

thank you :)

Seems to me its either web server problem or routing problem - can you give me your routing rules… Or there might be a session / cookie problem. Try with different browser, or try cleaning your cache.

Have you tried http://localhost/<sitepath>/gii/ ? Assuming you’re running locally.


I’m having the same problem. Yii version 1.1.5. All requirements passed. Running under xampp on windows. Freshly created webapp with

yiic webapp test

Page created and accessible via http://localhost/test/. No problems there.

Uncommenting the part in the main.php configuration file





going to http://localhost/test/index.php?r=gii (redirected to http://localhost/test1/index.php?r=gii/default/login)

Logging with the password and… that’s it. Nothing happens. I see the same url http://localhost/test/index.php?r=gii/default/login. When I’m using a wrong password it gives me an error. Nothing happens with the correct one.

Tried this with firefox, ie and chrome with same result.

Any ideas how to get it to work?



I see this topic is pretty old, but the problem is not solved yet.

The same problem was discussed in the russian subforum. PHP sessions didn’t work at all in Windows and the reason was a wrong config:

session.cookie_path \

changed to

session.cookie_path /

Here is a full version of the (default) working session config in Windows:

Session Support enabled

Registered save handlers        files user

Registered serializer handlers  php php_binary wddx

Directive       Local Value     Master Value

session.auto_start      Off     Off

session.bug_compat_42   Off     Off

session.bug_compat_warn Off     Off

session.cache_expire    180     180

session.cache_limiter   nocache nocache

session.cookie_domain   no value        no value

session.cookie_httponly Off     Off

session.cookie_lifetime 0       0

session.cookie_path     /       /

session.cookie_secure   Off     Off

session.entropy_file    no value        no value

session.entropy_length  0       0

session.gc_divisor      1000    1000

session.gc_maxlifetime  1440    1440

session.gc_probability  1       1

session.hash_bits_per_character 5       5

session.hash_function   0       0    PHPSESSID       PHPSESSID

session.referer_check   no value        no value

session.save_handler    files   files

session.save_path       C:\WINDOWS\Temp C:\WINDOWS\Temp

session.serialize_handler       php     php

session.use_cookies     On      On

session.use_only_cookies        On      On

session.use_trans_sid   0       0

Hope it helps.

Unable to login to the Gii interface. Pretty vanilla setup. Followed this and every other thread that tries to help with this issue on this site. Have edited the PHP.INI file as suggested above for Windows. It seems to me that someone should have a simple solution, which would allow for Gii to work simply by uncommenting the module in the main.php configuration file. Instead, literally hours of precious life is lost trying to get working, what should be a minor step in using yii on a development server.

Win XP

PHP 5.3

Yii 1.1.6






Have tried and also my lan ip for this machine and also tried gii login by commenting out the filer param…

Also could not get phpunit working. I understand that Windows/Microsoft sucks. I am stuck with it for now, as many people are who want to be able to work with PHP.

Any idea why I am getting the wrong password error in every browser, after clearing all cookies…etc?

If all else fail try this instead and it should work.


If Chris is experiencing an old password error, that means there is no problem with accessing Gii…Btw, Chris in Ohio, are you experiencing the incorrect password in Gii?

And uhmm…probably it would be better if a new topic will be created, instead of reviving an old topic. What do you think?

who are you directing this question to?

Hi chanh,

I am referring to Chris. I understand you just replied to his problem as a good forum member. :)

I had a same problem finally got it fixed. This was PHP’s session problem, as you mentioned, in the php session directory (in my case, /var/lib/php/session) the web server user (daemon) did not have the permission to write in.

I chowned the directory from root to daemon and it worked fine.


I have the same problem but i still can not resolve it. I chowned the directory (/var/lib/php5) from root to daemon, i have set permissions 777 for directory. It doesn`t work, please help me.

xsano33’s solution worked for me. Vashkatsi, check in your php.ini as to what dir you have set for session.save_path, and then make sure that folder is writable by your web user/group.

I used memcached before.

And I change session.save_handler from memcached to file and chmod 777 of the directory, then it works fine.

your php/session directory should be owned by the same user and group, which is configured in httpd.conf

for example, if in httpd.conf

User apache

Group apache

your /var/lib/php/session directory should be owned by the same User / Group.