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

  • Home
  • SEARCH
  • 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 8402289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:01:03+00:00 2026-06-09T22:01:03+00:00

I am getting error Call to a member function add() on a non-object on

  • 0

I am getting error “Call to a member function add() on a non-object” on Kohana::$log

There is not log in application/logs directory. The error I described is found on apache error_log. This is how it appears

[Fri Aug 17 17:07:09 2012] [error] [client MY.IPA.DDR.ESS] PHP Fatal error: Call to a member function add() on a non-object in /var/www/html/application/classes/kohana/exception.php on line 8

This is my error controller.

<?php
class Kohana_Exception extends Kohana_Kohana_Exception {
    public static function handler(Exception $e) {
        if (Kohana::DEVELOPMENT === Kohana::$environment) {
            parent::handler($e);
        } else {
            try {
                Kohana::$log->add(Log::ERROR, "own exception handler");
                Kohana::$log->add(Log::ERROR, parent::text($e));
                $attributes = array('action' => 500, 'message' => rawurlencode($e->getMessage()));
                if ($e instanceof HTTP_Exception) {
                    $attributes['action'] = $e->getCode();
                }
                // Error sub-request.
                echo Request::factory(Route::get('error')->uri($attributes))->execute()->send_headers()->body();
            }
            catch(Exception $e) {
                // Clean the output buffer if one exists
                ob_get_level() and ob_clean();
                // Display the exception text
                echo parent::text($e);
                // Exit with an error status
                exit(1);
            }
        }
    }
}

From the code it seems Kohana::$log is not initialized yet. But this code was working for long time. Now what made it not working?

I am using Kohana-3.2 with PHP 5.3.13 on Fedora 15

  • 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-09T22:01:04+00:00Added an answer on June 9, 2026 at 10:01 pm

    I have solved this problem. If this problem occurs to any other kohana developer and he comes here from google here is the solution.

    Run the following command from root shell. Remember if you reboot the server you’ll have to run it again.

    setsebool -P httpd_unified 1
    

    Additional informaiton: How to trace it.

    Check these location

    1. Apache error log
    2. Kohana logs (if you log for debugging) on application directory
    3. check the /var/log/messages.

    If its SElinux issue you’ll find log entry on /var/log/messages. This is what I got.

    setroubleshoot: SELinux is preventing /usr/sbin/httpd from write access on the directory /var/www/html/application/cache. For complete SELinux messages. run sealert -l 087dfdb5-c7de-4238-8e6b-a713213a456d

    As stated running sealert -l 087dfdb5-c7de-4238-8e6b-a713213a456d will reveal the command I wrote as solution.

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

Sidebar

Related Questions

I'm getting a Call to a member function fetchColumn() on a non-object error when
I'm getting: Fatal error: Call to a member function setAccessToken() on a non-object in
I'm getting: Fatal error: Call to a member function query() on a non-object in
I keep getting an error Call to a member function execute() on a non-object
Im getting Fatal error: Call to a member function prepare() on a non-object Error
Fatal error: Call to a member function prepare() on a non-object Is what I
I keep getting this error: cannot call member function 'QString Load::loadRoundsPlayed()'without object Now im
Error: Fatal error: Call to a member function bind_param() on a non-object in /var/www/web55/web/pdftest/events.php
I'm getting a Call to a member function process_data() on a non-object in page.class.php
Possible Duplicate: PHP Fatal error: Call to a member function Execute() on a non-object

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.