Unknown error while accessing controller

I have a User controller which I have created using Yii CRUD. It was working fine till last time when I made some changes. Now when I try to access it using the url http://HOST/index.php?r=user, a blank page comes up. I cannot find any output at all whatever action of that controller I use. The application is working fine for other controllers though.

I have enabled message logging but the particular issue doesn’t show up in that log. I also do not have any syntax error or anything in my code(I have checked it many times before posting this question). I am completely blank about how to debug it. Any help would be highly appreciated.

Maybe you are not logging all errors.

In your index.php write this line:




error_reporting('E_ALL');



Like that the error will be show up.

I have tried with that also, but still I am getting a blank page. :(

Can you post the actionIndex() function from your controller? Or whichever action is the default? Perhaps there is an error in that.

Also check the webservers error log file (!== Yii-Logfile).

Thanks Mike.

There was no syntax error. The error was - “Can’t use method return value in write context”. I was using method return value inside empty() in one of the actions inside the User controller. The error was logged in my apache error log file.

Does anybody know whether empty() is the only such function or we have some other php native functions which cannot be used with the return value?

afaik empty() can only check variable, it can’t check a return value…

perhaps you must use comparison syntax