I run a script through cronjobs on my site and under php 5 and I receive the following error codes I do not receive these when running php 4, I suspect these could be extension specific but I am not sure what they really mean. I have posted this on the Joomla boards and the extension support forum both without any replies.
Could someone her please advise on what these codes mean and how I might start to correct them
I thank you in anticipation

<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/mysite/public_html/joom15/libraries/joomla/session/session.php</b> on line <b>423</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/mysite/public_html/joom15/libraries/joomla/session/session.php:423) in <b>/home/mysite/public_html/joom15/libraries/joomla/session/session.php</b> on line <b>423</b><br />

<br />
<b>Warning</b>: ./cache/e15d96b612d132bd0ebc835041a0a222.spc is not writeable in <b>/home/mysite/public_html/joom15/administrator/components/com_feedgator/inc/simplepie/simplepie.inc</b> on line <b>1773</b><br />

    The first 2 errors are telling you that you could not execute a session_start() because headers were already sent due to output being generated at the files/line-numbers listed at the end of each error. Of course, a script being run via cron probably has little/no use for sessions in the first place, I would think. Possible fixes would be to get rid of the session_start()'s if you don't really need them, use output buffering (see [man]ob_start/man), or find out what is generating output and stopping it from doing so.

    I'm guessing that the last error is a symptom of a command line PHP script being run from the directory where it was invoked, not ncessarily the directory where the PHP file "lives", so the relative path may not be pointing to where you think it is. You could make it change to that directory within the script by adding the following to the start of the script:

    <?php
    chdir(dirname(__FILE__));
    

      Firstly I apologise for posting in the wrong forum and thank you for moving this thread.
      Thanks NogDog for the reply, at least this is somewhere to start. I didn't have a clue what to do .
      I will post back on progess 😃

        3 years later

        nogdog, you made a comment that "you probably wouldn't want to use sessions with cron" - which is normally true, but what if a person like me designs pages and scripts which work as both web pages and can also be called by cron? I have noted this same problem with session_start() in cron and wonder if there is a different way cron thinks than a web page.

        I also note that many vars I depend on such as $DOCUMENT_ROOT are not present when running cron..

        but, any insight on the session/cron warning message?

          i would suggest you detect command line call and disable sessions when the script is called that way. i really hope your not using $DOCUMENT_ROOT but $_SERVER[]

            Write a Reply...