Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8311881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:57:35+00:00 2026-06-08T19:57:35+00:00

I got error Fatal error: Class ‘CI_Controller’ not found in ….\core\CodeIgniter.php on line 233

  • 0

I got error Fatal error: Class ‘CI_Controller’ not found in ….\core\CodeIgniter.php on line 233

I create a class called My_Exceptions in application/core/My_Exception.php
Basically, I want to get email when user gets error from my site.

<?php
class My_Exceptions extends CI_Exceptions{
    var $CI="";
    function __construct(){
        parent::__construct();
        $this->CI =& get_instance();
    }
    function show_404($page = '', $log_error = TRUE)
{
    $heading = "404 Page My Not Found";
    $message = "The page you requested was not found.";

    // By default we log this, but allow a dev to skip it
    if ($log_error)
    {
        log_message('error', '404 Page Not Found --> '.$page);
    }

    //Email to Developer
    $this->CI->load->library('email');
    $uri = $this->CI->uri->uri_string();  
    $this->CI->email->from('error-donotreply@YOURAPP.com', 'APP Error');
    $this->CI->email->to('youremail@example.org');
    $this->CI->email->subject('APP Error [severity: '.$severity.']');
    $this->CI->email->message("Page not Found. From URL: ".$uri);
    $this->CI->email->send();

    echo $this->show_error($heading, $message, 'error_404', 404);
    exit;
}
}

Please help !!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:57:36+00:00Added an answer on June 8, 2026 at 7:57 pm

    The Exceptions class is loaded BEFORE the main CI_Controller.

    This means when an error occurs – you cannot use CI to send an email, because “$this->CI” does not exist.

    Your options are to either use the native PHP to send the email, or what I do; automatically email yourself the error logs from the day before (using a CRON job). That way you can review all the errors once a day.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing a Fatal error: Class 'Controller' not found in D:\wamp\www\CodeIgniter\application\controllers\blog.php on line
I've got the error [Solution at the end of the question] Fatal error: Class
I am using Dijkstra algorithm in PHP. But I got this error Fatal error:
Got some error in codeigniter when trying to call parent class. This is what
I installed a modification for my vbulletin suite and got this error Fatal error:
I got this error when I was installing the SugarCRM on the server: Fatal
I got a fatal error reading a file that was too big to fit
when I run the below code I got error in line echo $attribute; The
Say I've got the following: <?php abstract class MyParent { public static $table_name; public
I've got a class library in defined here .../projectname/library/Me/Myclass.php defined as follows: <?php class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.