Yii Framework Forum: All yii version authentication is failed after migration from Windows to OpenBSD - Yii Framework Forum

Jump to content

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

All yii version authentication is failed after migration from Windows to OpenBSD Rate Topic: -----

#1 User is offline   munemune 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 07-November 09

Posted 11 January 2010 - 01:02 PM

I have a problem, after using Windows for development and moving to OpenBSD for production. I cross some problem :

My application only failed at authentication, every time i try to open page and put a valid username/password my application redirecting to index.php file/login form (it's not login). If i put combination of wrong/right user/password its give a proper error message like 'your username not valid/your password it's not valid'.

To fix this i have try this (but nothing work) :

- Try to make default new aplication/test and try to login using demo/demo or admin/admin. (Failed its not even login!!)
- Try to change yii framework/clean install both yii and my application (Still Failed)
- Disable all authentication in my application (It's work i can go to address, and use my application normaly even i can CRUD on database)
- Move my application from OpenBSD to windows (In windows the authentication and my application its working!!!)
- Change authentication from database/tables to plain php code in my application (Failed)
- Make my authentication in my application to always return 'true' (Failed)

Can anyone please help me?

Moving from openBSD to Windows for webserver is not really option for my case.

Thank you.
0

#2 User is offline   gallego123 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 535
  • Joined: 11-August 09
  • Location:Argentina

Posted 11 January 2010 - 02:37 PM

View Postmunemune, on 11 January 2010 - 01:02 PM, said:

I have a problem, after using Windows for development and moving to OpenBSD for production. I cross some problem :

My application only failed at authentication, every time i try to open page and put a valid username/password my application redirecting to index.php file/login form (it's not login). If i put combination of wrong/right user/password its give a proper error message like 'your username not valid/your password it's not valid'.

To fix this i have try this (but nothing work) :

- Try to make default new aplication/test and try to login using demo/demo or admin/admin. (Failed its not even login!!)
- Try to change yii framework/clean install both yii and my application (Still Failed)
- Disable all authentication in my application (It's work i can go to address, and use my application normaly even i can CRUD on database)
- Move my application from OpenBSD to windows (In windows the authentication and my application its working!!!)
- Change authentication from database/tables to plain php code in my application (Failed)
- Make my authentication in my application to always return 'true' (Failed)

Can anyone please help me?

Moving from openBSD to Windows for webserver is not really option for my case.

Thank you.



I'm not sure, but try to delete the directory assets
KISS - Keep It Simple Stupid
ASAP-As Soon As Possible
http://www.yiiframew...oc/cookbook/71/
0

#3 User is offline   seb 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 240
  • Joined: 29-June 09

Posted 11 January 2010 - 04:19 PM

It is definitely some environment configuration issue.
Try to use CDbHttpSession - set in config/main.php:
        'session'=>array(
            'class' => 'CDbHttpSession',
            'connectionID' => 'db',
            'sessionTableName' => 'db_session',
        ),

If this does not help, try to compare php.ini on windows and on OpenBSD (or compare phpinfo() output).
0

#4 User is offline   munemune 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 07-November 09

Posted 11 January 2010 - 06:09 PM

Thank you for replying.

@Horacio Segura

Quote

I'm not sure, but try to delete the directory assets


The authentication still wont work

@seb

Quote

It is definitely some environment configuration issue.
Try to use CDbHttpSession - set in config/main.php


Same, the authentication still wont work.

Quote

If this does not help, try to compare php.ini on windows and on OpenBSD (or compare phpinfo() output).


Haven't try this but i will.
0

#5 User is offline   munemune 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 07-November 09

Posted 11 January 2010 - 10:51 PM

Well after check my phpinfo() as seb suggested

I found the problem is.

The problem lies NOT ON apache or yii. But on my OpenBSD and default php.ini.

Problem lies on :
OpenBSD by default will chroot-ed /var/www thats make /tmp cant be accesed from inside /var/www, add that the default OpenBSD php.ini not set the "session.save_path" variable.

Solution is :
Make tmp dir in /var/www so the path become /var/www/tmp. Chmod it
chmod 777 /var/www/tmp
. Add the session path variable in php.ini.
session.save_path="/tmp"
(dont add slash /). Restart apache, check phpinfo() make sure session.save_path has been set.

Create new clean test yii application, try login using demo/demo or admin/admin. If succeed "login" menu will change to "logout".
Then migrate my application.

Hopes will help others who have same problem. Thank You
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