ElitePirate
Active Member
hi
I have stored my db details in a file called config.php
config.php
I have a cron file which runs perfectly fine.
Cron.php
This cron works perfectly fine. Now i need another cron file. I copied the same exact content of this cron file and created a new cron file called cron2.php and set the cron timing to every 1 minutes and i got this error in the error log
[18-Jan-2013 20:30:01] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in /home/xxxxx/public_html/xxxx/inc/config.php on line 2
[18-Jan-2013 20:30:01] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent in /home/xxxxx/public_html/xxxx/inc/config.php on line 2
I really don't understand how come if its 1 cron file its working flawlessly and if its 2 different cron files it gives this error. Can anyone suggest a work around?
Thanks
Elite
I have stored my db details in a file called config.php
config.php
PHP:
<?php
session_start();
//error_reporting(E_ALL);
ini_set('display_errors',0);
$glob['dbhost'] = "localhost";
.....
.....
.....
I have a cron file which runs perfectly fine.
Cron.php
PHP:
<?php include("inc/config.php");
$to_mail = 'myemail@gmail';
$sql=$dclass->select('*','tbl_test');
.....
.....
.....
This cron works perfectly fine. Now i need another cron file. I copied the same exact content of this cron file and created a new cron file called cron2.php and set the cron timing to every 1 minutes and i got this error in the error log
[18-Jan-2013 20:30:01] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in /home/xxxxx/public_html/xxxx/inc/config.php on line 2
[18-Jan-2013 20:30:01] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent in /home/xxxxx/public_html/xxxx/inc/config.php on line 2
I really don't understand how come if its 1 cron file its working flawlessly and if its 2 different cron files it gives this error. Can anyone suggest a work around?
Thanks
Elite