Author Topic: Odd error for cron on nws-alerts.php  (Read 904 times)

0 Members and 1 Guest are viewing this topic.

Offline jay_hoehn

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 656
    • Jay's Woodcrafts
Odd error for cron on nws-alerts.php
« on: April 18, 2014, 02:57:37 PM »
I have moved my site from GoDaddy to another host.  I set up the cron job to get the alerts and am getting this error.  Any ideas.  Seems the cron is working but looking for something else also.
Quote
<br />
<b>Warning</b>:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/home/jayswo5/public_html/wx/include-style-switcher.php</b> on line <b>31</b><br />
<br />
<b>Warning</b>:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/jayswo5/public_html/wx/include-style-switcher.php:31) in <b>/home/jayswo5/public_html/wx/include-style-switcher.php</b> on line <b>31</b><br />
<!-- nws-alerts.php - 1.15 - 19-Aug-2013 - NWS Public Alerts -->
<!-- Cron job enabled -->
<!-- Preliminary codes checked: 6 -->
<!-- Preliminary data cull: 0.8138 seconds -->
<!-- Average cull per code: 0.1356 seconds -->
<!-- Primary alerts downloaded: 0 -->
<!-- Primary data cull: 0.0000 seconds -->
<!-- Cache file updated: Fri 12:52 pm -->
<!-- Alert box data file updated -->
<!-- Icon data file updated -->
<!-- Total script process time: 0.8374 seconds -->
Thanks,

Jay
« Last Edit: April 18, 2014, 02:59:21 PM by jay_hoehn »
Davis Vantage Pro2 Plus
VVP
Weather Display


Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: Odd error for cron on nws-alerts.php
« Reply #1 on: April 18, 2014, 04:28:46 PM »
The first line in the nws-alerts file will display the version and date before any part of the script does any processing.
Code: [Select]
<!-- nws-alerts.php - 1.15 - 19-Aug-2013 - NWS Public Alerts -->It's showing the nws-alerts.php file executed normally.

The nws-alerts doesn't use session so the error happens right before the alert box loads.
Do you have something similar to this in the index.php file or header.php file?
Code: [Select]
session_start();

Offline jay_hoehn

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 656
    • Jay's Woodcrafts
Re: Odd error for cron on nws-alerts.php
« Reply #2 on: April 18, 2014, 04:46:04 PM »
Curly,

That code
Quote
if( !isset( $_SESSION ) ) {
    session_start();
is on the include-style-switcher.php page.  Not sure if the error needs to be addressed since the cron is doing its job.

Jay
Davis Vantage Pro2 Plus
VVP
Weather Display


 

anything