Yii Framework Forum: Yii silently crashes - Yii Framework Forum

Jump to content

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

Yii silently crashes I receive 500 Internal Server Error when have a mistake in source code Rate Topic: -----

#1 User is offline   vojtek 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 29-May 12

Posted 29 May 2012 - 03:26 PM

Hi,
I'm new to Yii, it's great but one thing makes me really angry. When I made a mistake, which is not syntax error or null reference (e.g. I use function that does not exist) - the Yii just stops. If it's in view script - its trackable, because I can see where HTML stops rendering. But when it comes to controller or model - I receive 500 Internal Server Error.

I generated application with yiic command. I have the YII_DEBUG set to true and the YII_TRACE_LEVEL to 3.

How to fix this?
0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 532
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 29 May 2012 - 05:32 PM

can you post the complete content of your index.php?
You should get a very nice stacktrace of what happended instead of error 500 when YII_DEBUG is true.
0

#3 User is offline   vojtek 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 29-May 12

Posted 30 May 2012 - 02:15 AM

Here: http: / / pasteit.com/17828 (I'm not allowed to post links yet).
I get the pretty debug for these errors on both localhost and my hosting (code in actionIndex in the SiteController):
  • $this->unknownMethod()
  • $this->nothing->getSomenthing()


I get 500 Internal Server Error on hosting and pure PHP error on localhost, when:
  • do the syntax error (e.g. forget ";")
  • call to undefined function (e.g. undefinedFunction())


I actually solved this problem with
error_reporting(E_ALL);
ini_set('display_errors', 'On');

in my index.php, but I only receive a pure PHP error in both localhost and hosting. Is this normal?
1

#4 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,739
  • Joined: 17-January 09
  • Location:Russia

Posted 30 May 2012 - 06:35 AM

Yes, it's OK. There's no good way to catch such errors in PHP.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#5 User is offline   Vicer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 06-November 12

Posted 24 September 2013 - 01:27 AM

I was hunting through the web trying to understand why this bloody framework doesn't give me a helpful error before crashing! It's really annoying

thanks to vojtek above. Thanks error reporting setting is some consolation.
0

#6 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,739
  • Joined: 17-January 09
  • Location:Russia

Posted 24 September 2013 - 03:21 AM

In Yii2 we've solved catching all kind of errors, even the ones that normally aren't catchable so it should be a big step forward in this regard.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
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