Yii Framework Forum: Class 'yii\web\CHttpException' not found - Yii Framework Forum

Jump to content

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

Class 'yii\web\CHttpException' not found Rate Topic: -----

#1 User is offline   phantomlord 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 15-October 17

Posted 07 November 2017 - 06:25 AM

I am trying to generate 404 error using the following call:
throw new \yii\web\CHttpException(404, 'User not found')


I get error 500 sent to the browser. When I look into nginx logs I see:

Quote

PHP Fatal error: Class 'yii\web\CHttpException' not found in /path/to/file/...


Any ideas how to fix?
0

#2 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,824
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 07 November 2017 - 08:35 AM

Yii 1.x
http://www.yiiframew...sing-exceptions

(Yii 2
http://www.yiiframew...g-error-handler)
Don't forget to read The Definitive Guide to Yii (1.1 en) (1.1 sv) (2.0 en) | The class reference (1.1) (2.0) has the details
0

#3 User is offline   phantomlord 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 15-October 17

Posted 07 November 2017 - 11:36 AM

Great , thanks!
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