CMSB Cron Run Manually Header Info Warning

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 13, 2015   (RSS)

By Steve99 - January 13, 2015

Hello,

I ran the example Cron manually in browser and am receiving a "cannot modify header info" warning. This portion of the example Cron:

  if (!inCLI()) { // if "Running Manually" from web
    header("Content-type: text/plain", true);
    set_time_limit(60*5);  // allow up to 5 minutes to complete task
    session_write_close(); // End the current session and store session data so locked session data doesn't prevent concurrent access to CMS by user while this script is running
  }    

is giving this warning:

Warning: Cannot modify header information - headers already sent by (output started at /full/server/path/www/htdocs/cmsAdmin/lib/common.php:1626) in /full/server/path/www/htdocs/cmsAdmin/plugins/cron-example.php on line 37
My sample Cron
--------------------------------------------------------------------------------
The current time is: 2015-01-13 12:14:47

Done!

I've included that chunk of code in a Cron I'm working on as well. The task completes, but that error is displayed/logged. Thoughts?

Thanks,
Steve

By Steve99 - January 13, 2015

Hi Claire,

I thought that to be the case, just wanted to confirm. Thanks!

Cheers,
Steve