• We’ve been using this plugin for years and love how much easier it makes managing and testing our custom plugins’ cron functions.

    One issue that we’ve noticed, though, is that when we use the “Run Now” function, any errors will cause the function to silently fail without producing any output anywhere.

    For example, if we use the Run Now function to run a cron with this code:

    error_log('error test 1');
    $error_test = 5 / 0;
    error_log('error test 2');

    The last line of the Apache error log will say “error test 1”.

    Since PHP and Apache can be configured in many different ways, this may not happen everywhere, but it may be worth looking into to see if there’s some type of fallback option that can be added. In our case, we’re using Cloudways as our managed host.

    Thankfully, in our case, we can still view the errors by manually setting the cron to a past date and then wait for our system crontab to run the crons and output the errors to a custom log file, which works well. But if there was a way to get the Run Now function to work correctly as well, that would be very helpful.

Viewing 1 replies (of 1 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Thanks for the report. I’ve tried very hard to ensure that when you use “Run Now” in WP Crontrol that it runs the event in the same manner as it runs when scheduled normally (some other cron management plugins simply call the action for the event which means the context for the request is incorrect). What happens behind the scenes is it schedules an event in the past and then immediately spawns the cron event runner.

    So there shouldn’t be any difference in behaviour between run now and the scheduled event running, but it looks like in your case there is and it’s probably due to your events being run externally by crontab. I wonder if there’s a difference in configuration for your command line PHP versus your Apache/fpm/cgi PHP. The former might not be configured to log errors?

Viewing 1 replies (of 1 total)
  • The topic ‘Viewing error output when using “Run Now”’ is closed to new replies.