Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fatal error: Exception thrown without a stack frame in Unknown on line 0
  • After working on some code today, I came across this error.

    What's odd is that EVERYTHING loads fine. The page renders, no warnings, nothing. Then, after the template is pushed to the browser, the error message "Fatal error: Exception thrown without a stack frame in Unknown on line 0" is sent as well.

    Any ideas on how to trace this? My basic logic inside the controller is: 
                    // Get the layout
    $layout = View::forge('template/layout');
    // Set global view variables
    $layout->set_global('title', 'Dashboard');
    // Pass in the views
    $layout->header = View::forge('template/header');
    $layout->menu = View::forge('template/menu');
    $layout->content = View::forge('template/content', array('page_content' => View::forge('something/index')));
    $layout->footer = View::forge('template/footer');
    // Push out the view
    return $layout;

    I would normally expect the error injected into the page where it hit some bad code somewhere... not AFTER the layout is returned.

    Any help?
  • HarroHarro
    Accepted Answer
    This indicates an error in either the error handler or the shutdown handler (most likely). By this time PHP is already tearing down the session, and no error handler is available anymore, so it barfs out this fine and descriptive error message... :-(

    Try searching here, it's been discussed before, perhaps that can give you some pointers.
  • Okay, I actually found the issue... 

    I searched for the general error on Google and came across this link that mentions having this error thrown when storing objects in Session, or at least some serialization issue. I had just changed some code to store some often-used values in session.

    I removed that and can handle it another way. But, is there a good way to store these values (like a list of objects returned from a model) where they're easily accessible to multiple functions within the controller? Like a global variable that can be accessed by all functions within the controller or across multiple controllers?

    Thanks for the help!
  • What session driver are you using?

    Objects tend to be very big, so storing them in the session might not be a good idea. Also, if you use ORM, know that objects are cached, so you can do a find on primary key in another method without it generating a new query.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion