Yii Framework Forum: Unknown error while accessing controller - Yii Framework Forum

Jump to content

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

Unknown error while accessing controller Rate Topic: -----

#1 User is offline   kumar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 24-May 10

Posted 21 June 2010 - 12:38 PM

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

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 21 June 2010 - 01:24 PM

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

#3 User is offline   kumar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 24-May 10

Posted 21 June 2010 - 09:06 PM

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

#4 User is offline   M Wotton 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 01-November 09

Posted 21 June 2010 - 11:54 PM

View Postkumar, on 21 June 2010 - 09:06 PM, said:

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.
Micha Wotton
Posted Image
0

#5 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 22 June 2010 - 03:39 AM

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

#6 User is offline   kumar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 24-May 10

Posted 22 June 2010 - 01:01 PM

View PostMike, on 22 June 2010 - 03:39 AM, said:

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?
0

#7 User is offline   junxiong 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 541
  • Joined: 21-June 10

Posted 22 June 2010 - 01:23 PM

View Postkumar, on 22 June 2010 - 01:01 PM, said:

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
“The most likely way for the world to be destroyed, most experts argue, is by accident. That’s where we come in; we’re computer professionals. We cause accidents.” - Nathaniel Borenstein

Yii Playground : Collaborative demo apps. You can join to improve it too!
My Team's Blog: In Indonesian.
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