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 7982673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:44:29+00:00 2026-06-04T10:44:29+00:00

How can I log a fatal error occuring within a call_user_func_array? Its within a

  • 0

How can I log a fatal error occuring within a call_user_func_array?
Its within a CLI script that runs as a daemon.
I would like to log when an error occurs, but instead it always throws the error message back.

things that I tried but couldn’t make it work:

try {call_user_func_array()} catch (Exception $e ) {do_log}

or

ob_start ();
try {call_user_func_array()} catch (Exception $e ) {do_log}

or

register_shutdown_function('shutdownFunction');

or

ini_set('error_log',$baseDir.'/Jobque_error.log');
fclose(STDIN);
fclose(STDOUT);
fclose(STDERR);
$STDIN = fopen('/dev/null', 'r');
$STDOUT = fopen($baseDir.'/Jobque_application.log', 'ab');
$STDERR = fopen($baseDir.'/Jobque_daemon.log', 'ab');
  • 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-04T10:44:31+00:00Added an answer on June 4, 2026 at 10:44 am

    You cannot catch a fatal error. It is fatal so your script dies and there is nothing you can do about it.

    Actually, a function registered via register_shutdown_handler will still execute but you cannot get a backtrace etc. so that’s pretty useless.

    The only possible logging of a fatal error is via the log_errors php.ini setting.

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

Sidebar

Related Questions

How can I log the following error to a text file or database? Fatal
I would like to make it so that my scripts can continue to run
Is there a project that can log errors in requests to Django on Google
By looking into the Open JPA website i've found that i can log the
HI, I have a device that exposes a telnet interface which you can log
I know, that by its very definition, a fatal exception is supposed to kill
Recently got this in my Event Log: A fatal hardware error has occurred. Reported
Something in my PHP script is causing a fatal error, but I ca't seem
Hi I know that this error which I'm going to show can't be fixed
I've gone over this script like 30 times, and I can't for the life

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.