All yii version authentication is failed after migration from Windows to OpenBSD

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

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).

Thank you for replying.

@Horacio Segura

The authentication still wont work

@seb

Same, the authentication still wont work.

Haven’t try this but i will.

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