I started tweaking the login process as described here: (since I can’t add links here, google “custom-authentication-using-the-yii-framework”)
After entering login and password my browser gives me a 500 HTTP error.
How can I proceed to debug if I don’t see any data?
The application.log file is empty as well.
I added to index.php:
It allowed me to see the syntax error. However, is that really the best way to do that? Or does Yii have a better way?
It depends on what kind of mistake you’ve made. If you are doing something like calling_non_existent_function() you will get a fatal error. So you might want to play around with error_reporting. Using an IDE would be sufficient to avoid stuff like that.
When you are doing something like $user->calling_non_existent_function(), blahblah::blahblah(), echo $user->non-existend-paramter etc Yii will be able to handle it for you with CException and given you are in the debug mode, you will get a nice stack of what went wrong.
Also since Yii uses __set extensively, by design you won’t be able to do something like $user->non_declared_variable = “foo”, which you would normally be able to do. (with E_NOTICE you would get warned, though)
btw, make sure YII_DEBUG is true.
And read this http://www.yiiframework.com/doc/guide/1.1/en/topics.error